فهرست منبع

Merge remote-tracking branch 'origin/master'

zxhxx 3 سال پیش
والد
کامیت
ed0d853492
6فایلهای تغییر یافته به همراه83 افزوده شده و 2 حذف شده
  1. 1 0
      .htaccess
  2. 26 0
      404.html
  3. 1 0
      app/admin/view/ump/store_wholesale/index.php
  4. 13 2
      app/models/store/Package.php
  5. 2 0
      app/models/store/StoreWholesale.php
  6. 40 0
      index.html

+ 1 - 0
.htaccess

@@ -0,0 +1 @@
+ 

+ 26 - 0
404.html

@@ -0,0 +1,26 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+<title>404</title>
+<style>
+	body{
+		background-color:#444;
+		font-size:14px;
+	}
+	h3{
+		font-size:60px;
+		color:#eee;
+		text-align:center;
+		padding-top:30px;
+		font-weight:normal;
+	}
+</style>
+</head>
+
+<body>
+<h3>404,您请求的文件不存在!</h3>
+</body>
+</html>

+ 1 - 0
app/admin/view/ump/store_wholesale/index.php

@@ -116,6 +116,7 @@
             {field: 'id', title: 'ID', sort: true,width:'6%',event:'id'},
             {field: 'image', title: '商品图片', width: '10%',templet: '<p><img src="{{d.image}}" alt="{{d.title}}" class="open_image" data-image="{{d.image}}"></p>'},
             {field: 'title', title: '活动标题'},
+            {field: 'time_id_title', title: '时间段'},
             {field: 'info', title: '活动简介',width:'20%'},
             {field: 'ot_price', title: '原价',width:'6%'},
             {field: 'price', title: '批发价',width:'6%'},

+ 13 - 2
app/models/store/Package.php

@@ -169,7 +169,7 @@ class Package extends BaseModel
      */
     public static function time_out()
     {
-        $list = self::where('status',1)->where('add_time','<',strtotime("-".sys_config('order_whole_time')." hour"))->select();
+        $list = self::where('status',0)->where('add_time','<',strtotime("-".sys_config('order_whole_time')." hour"))->select();
         foreach ($list as $v)
         {
             if($v['last_id']>0) self::edit(['status'=>2],$v['last_id']);
@@ -189,13 +189,18 @@ class Package extends BaseModel
     {
         $data['status'] = 2;
         $data['paid'] = 1;
-        $list = self::where('pay_time', '<', strtotime("-" . sys_config('order_whole_time') . " hour"))->select()->toArray();
+        $list = self::where('pay_time', '<', strtotime("-" . sys_config('order_whole_time') . " hour"))->where('status',1)->select()->toArray();
         self::beginTrans();
         try {
             foreach ($list as $info) {
                 $package_income = bcmul($info['price'], bcdiv(sys_config('package_income'), 100, 3), 2);
                 User::where('uid', $info['to_uid'])->dec('gold', $package_income)->update();
                 $to_user = User::where('uid', $info['to_uid'])->find();
+                if($to_user['gold']<=0)
+                {
+                      User::where('uid', $info['to_uid'])->update(['gold'=>0]);
+                      continue;
+                }
                 UserBill::income('扣除收益', $info['to_uid'], 'gold', 'dec', $package_income, $info['id'], $to_user['gold'], '订单未确认收货系统确认,扣除收益' .$package_income );
                 if ($info['last_id'] > 0) self::edit(['status' => 4], $info['last_id']);
             }
@@ -293,8 +298,14 @@ class Package extends BaseModel
         if(isset($where['time_id']) && $where['time_id']>-4) $model = $model->where('time_id',$where['time_id']);
         $count = $model->value('count(id)')?:0;
         $data = $model->order('id desc')->page($where['page'],$where['limit'])->select()->toarray();
+        $whole = [];
+        foreach (sys_data('whole_time') as $v)
+        {
+            $whole[$v['id']] = $v['time'];
+        }
         foreach ($data as &$v)
         {
+            $v['time_id_title'] = $whole[$v['time_id']];
             if($v['whole_id']) {
                 $v['whole'] = StoreWholesale::find($v['whole_id']);
             }

+ 2 - 0
app/models/store/StoreWholesale.php

@@ -287,6 +287,7 @@ class StoreWholesale extends BaseModel
 
                     if ($config) {
                         $arr = json_decode($config->value, true);
+                
                         $now_hour = date('H', time());
                         $start_hour = $arr['time']['value'];
                         $continued = $arr['continued']['value'];
@@ -298,6 +299,7 @@ class StoreWholesale extends BaseModel
                         } else {
                             $item['start_name'] = '正在进行中';
                         }
+                        $item['time_id_title'] = $arr['time']['value'];;
                     } else {
                         $item['start_name'] = '正在进行中';
                     }

+ 40 - 0
index.html

@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>恭喜,站点创建成功!</title>
+    <style>
+        .container {
+            width: 60%;
+            margin: 10% auto 0;
+            background-color: #f0f0f0;
+            padding: 2% 5%;
+            border-radius: 10px
+        }
+
+        ul {
+            padding-left: 20px;
+        }
+
+            ul li {
+                line-height: 2.3
+            }
+
+        a {
+            color: #20a53a
+        }
+    </style>
+</head>
+<body>
+    <div class="container">
+        <h1>恭喜, 站点创建成功!</h1>
+        <h3>这是默认index.html,本页面由系统自动生成</h3>
+        <ul>
+            <li>本页面在FTP根目录下的index.html</li>
+            <li>您可以修改、删除或覆盖本页面</li>
+            <li>FTP相关信息,请到“面板系统后台 > FTP” 查看</li>
+            <li>更多功能了解,请查看<a href="https://www.bt.cn" target="_blank">宝塔官网(www.bt.cn)</a></li>
+        </ul>
+    </div>
+</body>
+</html>