作者 邓超

log

... ... @@ -59,6 +59,22 @@ class SendJob {
if($lists){
foreach ($lists as $list){
if($list['status'] === 1) {
$total = db()->first(\Model\sendJobStatusSql::countSum($list['id']));
if ($total && $total['t'] == $list['total']) {
// 更新状态
db()->update(\Model\sendJobsSql::$table, [
'status' => 2,
'success' => $total['s'],
'error' => $total['e'],
], dbWhere(['id' => $list['id']]));
continue;
}
}
$this->go_($list);
}
}else{
... ...
... ... @@ -26,7 +26,7 @@ class sendJobsSql {
*/
public static function sendList($limit):string {
// 控制在500数量,协程数量就控制
return "select * from `".self::$table."` where `status` = 0 and `send_time` <= ".time()." limit {$limit}";
return "select * from `".self::$table."` where `status` in (0,1) and `send_time` <= ".time()." limit {$limit}";
}
... ...