代码优化

This commit is contained in:
wong
2025-12-05 11:36:03 +08:00
parent 2697da15aa
commit 63df35b79c
3 changed files with 24 additions and 18 deletions

View File

@@ -130,11 +130,14 @@ class WorkbenchMomentsJob
// 3) 下发
$moments = new Moments();
$moments->addJob($sendData);
KfMoments::where(['id' => $val['id']])->update(['isSend' => 1]);
$res = $moments->addJob($sendData);
$res = json_decode($res, true);
if ($res['code'] == 200){
KfMoments::where(['id' => $val['id']])->update(['isSend' => 1]);
// 4) 统计
$this->incrementSendStats($companyId, $userId, $allowed);
// 4) 统计
$this->incrementSendStats($companyId, $userId, $allowed);
}
}
} catch (\Exception $e) {
Log::error("朋友圈同步任务异常: " . $e->getMessage());
@@ -334,9 +337,12 @@ class WorkbenchMomentsJob
];
// 发送朋友圈
$moments = new Moments();
$moments->addJob($data);
// 记录发送记录
$this->recordSendHistory($workbench, $devices, $contentLibrary);
$res = $moments->addJob($data);
$res = json_decode($res,true);
if ($res['code'] == 200){
// 记录发送记录
$this->recordSendHistory($workbench, $devices, $contentLibrary);
}
}