作者 邓超

x

... ... @@ -211,16 +211,18 @@ class SendJob {
$this->cnum--;
// 验证是否完成
if($data['maildata']['massSuit']??0){
$total = db()->first(\Model\sendJobStatusSql::countSum($data['id']));
if($total){
// 更新状态
db()->update(\Model\sendJobsSql::$table,[
'status' => $total['t'] == $data['total'] ? 2 : 0,
'success' => $total['s'],
'error' => $total['e'],
],dbWhere(['id'=>$data['id']]));
$dst = db()->first(\Model\sendJobsSql::isStatus($data['id']));
if($dst && $dst['status'] != 3){
$total = db()->first(\Model\sendJobStatusSql::countSum($data['id']));
if($total){
// 更新状态
db()->update(\Model\sendJobsSql::$table,[
'status' => $total['t'] == $data['total'] ? 2 : 0,
'success' => $total['s'],
'error' => $total['e'],
],dbWhere(['id'=>$data['id']]));
}
}
}
// 写入日志
... ...