...
|
...
|
@@ -90,7 +90,11 @@ function start(){ |
|
|
}else{
|
|
|
$result = \Lib\Mail\MailFun::sendEmail($data['maildata'],$email);
|
|
|
// 更新状态
|
|
|
\Model\sendJobsSql::upStatus($data['id'],2,db());
|
|
|
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'],
|
...
|
...
|
@@ -105,10 +109,15 @@ function start(){ |
|
|
$cNum--;
|
|
|
// 验证是否完成
|
|
|
if($data['maildata']['massSuit']??0){
|
|
|
$total = db()->count(\Model\sendJobStatusSql::count($data['id']));
|
|
|
|
|
|
// 更新状态
|
|
|
\Model\sendJobsSql::upStatus($data['id'],$total == $data['total'] ? 2 : 0,db());
|
|
|
$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']]));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
|