作者 邓超

log

@@ -59,6 +59,22 @@ class SendJob { @@ -59,6 +59,22 @@ class SendJob {
59 59
60 if($lists){ 60 if($lists){
61 foreach ($lists as $list){ 61 foreach ($lists as $list){
  62 + if($list['status'] === 1) {
  63 + $total = db()->first(\Model\sendJobStatusSql::countSum($list['id']));
  64 + if ($total && $total['t'] == $list['total']) {
  65 + // 更新状态
  66 + db()->update(\Model\sendJobsSql::$table, [
  67 + 'status' => 2,
  68 + 'success' => $total['s'],
  69 + 'error' => $total['e'],
  70 + ], dbWhere(['id' => $list['id']]));
  71 +
  72 + continue;
  73 + }
  74 +
  75 + }
  76 +
  77 +
62 $this->go_($list); 78 $this->go_($list);
63 } 79 }
64 }else{ 80 }else{
@@ -26,7 +26,7 @@ class sendJobsSql { @@ -26,7 +26,7 @@ class sendJobsSql {
26 */ 26 */
27 public static function sendList($limit):string { 27 public static function sendList($limit):string {
28 // 控制在500数量,协程数量就控制 28 // 控制在500数量,协程数量就控制
29 - return "select * from `".self::$table."` where `status` = 0 and `send_time` <= ".time()." limit {$limit}"; 29 + return "select * from `".self::$table."` where `status` in (0,1) and `send_time` <= ".time()." limit {$limit}";
30 } 30 }
31 31
32 32