作者 邓超

log

... ... @@ -72,10 +72,11 @@ class SendJob {
continue;
}
}else{
$this->go_($list);
}
$this->go_($list);
}
}else{
// 休眠30秒
... ... @@ -181,20 +182,27 @@ class SendJob {
}
else{
$result = \Lib\Mail\MailFun::sendEmail($data['maildata'],$email);
// 更新状态
db()->update(\Model\sendJobsSql::$table,[
'status' => 2,
'success' => $result[0] ? $data['total'] : 0,
'error' => $result[0] ? 0 : $data['total'],
],dbWhere(['id'=>$data['id']]));
// 插入紫薯精
db()->insert(\Model\sendJobStatusSql::$table,[
'job_id' => $data['id'],
'to_email' => 'all',
'status' => $result[0] ? 1 : 0,
'error' => $result[0] ? $result[1] : ''
]);
// 是否已发送过了
if(!db()->count(\Model\sendJobStatusSql::count($data['id'],'all'))){
$result = \Lib\Mail\MailFun::sendEmail($data['maildata'],$email);
// 更新状态
db()->update(\Model\sendJobsSql::$table,[
'status' => 2,
'success' => $result[0] ? $data['total'] : 0,
'error' => $result[0] ? 0 : $data['total'],
],dbWhere(['id'=>$data['id']]));
// 插入紫薯精
db()->insert(\Model\sendJobStatusSql::$table,[
'job_id' => $data['id'],
'to_email' => 'all',
'status' => $result[0] ? 1 : 0,
'error' => $result[0] ? $result[1] : ''
]);
}else{
_echo('发送过了 '.$data['id']);
}
}
// 协程结束后
... ...