Browse Source

会员升级

Kirin 1 year ago
parent
commit
88bb3640b8
1 changed files with 5 additions and 8 deletions
  1. 5 8
      app/services/user/AwardIntegralServices.php

+ 5 - 8
app/services/user/AwardIntegralServices.php

@@ -261,18 +261,16 @@ class AwardIntegralServices extends BaseServices
     {
         $sum = $this->dao->search()->whereTime('add_time', 'yesterday')->sum('order_price');
         $system_check = sys_config('system_achievement_check', 10000);
-        if ($sum < $system_check) {
-            $this->dao->search()->where('status', 0)->where('sent_num<num')->inc('stop_day', sys_config('fail_inc_send_day', 1))->update();
-//            $update['send_time'] = time();
-//            $this->dao->search()->where('status', 0)->where('sent_num<num')->where('send_time', '<', $test ? (time() + 1000) : strtotime('today'))->update($update);
-//            return true;
-        }
         $list = $this->dao->search()->where('status', 0)->where('sent_num<num')->where('send_time', '<', $test ? (time() + 1000) : strtotime('today'))->limit($test ? 10000 : 50)->select();
         foreach ($list as $v) {
-
+            $update = [];
+            if ($sum < $system_check) {
+                $v['stop_day'] = $v['stop_day'] + sys_config('fail_inc_send_day', 1);
+            }
             if ($v['stop_day'] > 0) {
                 $this->dao->search()->where('id', $v['id'])->dec('stop_day', 1)->update();
                 $update['send_time'] = time();
+                $update['stop_day'] = $v['stop_day'] - 1;
                 $this->dao->search()->where('id', $v['id'])->update($update);
                 continue;
             }
@@ -284,7 +282,6 @@ class AwardIntegralServices extends BaseServices
 
             $real_send = $day_send + $up_speed;
             $left = $v['num'] - $v['sent_num'];
-            $update = [];
             $update['day_send'] = $day_send;
             $update['up_speed_used'] = $v['up_speed_used'] + $up_speed;
             $update['sent_day'] = $v['sent_day'] + 1;