stanley-king 2 年 前
コミット
0546f79781
1 ファイル変更15 行追加12 行削除
  1. 15 12
      crontab/control/minutes.php

+ 15 - 12
crontab/control/minutes.php

@@ -456,12 +456,14 @@ class minutesControl extends BaseCronControl
         $update_earlist_sendtime = function () {
             $mod = Model('refill_detail');
             $time = $mod->getLatestSendTime();
-            wcache('latest_send_time',$time,'refill-stat');
+            wcache('latest_sending', ['order_time' => $time], 'refill-stat-');
 
             Log::record("latest_send_time={$time}",Log::DEBUG);
         };
 
+
         $update_earlist_sendtime();
+
     }
 
     /**
@@ -507,19 +509,18 @@ class minutesControl extends BaseCronControl
             $method = '_cron_'.$k;
             Log::record("crontab minutest:{$method}",Log::DEBUG);
 
-            $result = call_user_func_array([$this,'_cron_'.$k], [$v]);
-            if (is_array($result)){
-                $cronid = array_merge($cronid,$result);
-            }
-            else {
-                $method = '_cron_'.$k;
-                Log::record("crontab minutest err:{$method}",Log::ERR);
+            $result = call_user_func_array([$this, '_cron_' . $k], [$v]);
+            if (is_array($result)) {
+                $cronid = array_merge($cronid, $result);
+            } else {
+                $method = '_cron_' . $k;
+                Log::record("crontab minutest err:{$method}", Log::ERR);
             }
         }
 
         //删除执行完成的cron信息
-        if (!empty($cronid) && is_array($cronid)){
-            $model_cron->delCron(['id'=> ['in',$cronid]]);
+        if (!empty($cronid) && is_array($cronid)) {
+            $model_cron->delCron(['id' => ['in', $cronid]]);
         }
 
         return true;
@@ -532,13 +533,15 @@ class minutesControl extends BaseCronControl
     {
         $condition = ['goods_commonid' => ['in',array_keys($cron)]];
         $update = Model('goods')->editProducesOnline($condition);
-        if ($update){
+        if ($update)
+        {
             //返回执行成功的cronid
             $cronid = [];
             foreach ($cron as $v) {
                 $cronid[] = $v['id'];
             }
-        } else {
+        }
+        else {
             return false;
         }
         return $cronid;