修改自动推广的相关任务

This commit is contained in:
wangjinlei
2026-05-08 15:38:15 +08:00
parent b1e978ed73
commit 336fa08a18
9 changed files with 116 additions and 151 deletions

View File

@@ -4,7 +4,6 @@ namespace app\api\job;
use think\queue\Job;
use app\common\PromotionService;
use app\common\QueueJob;
/**
* 队列任务:单封邮件 prepare调用 LLM 生成个性化描述 + 渲染模板 + 写入 log
@@ -18,41 +17,13 @@ use app\common\QueueJob;
*/
class PromotionPrepareEmail
{
// private $oQueueJob;
// public function __construct()
// {
// $this->oQueueJob = new QueueJob();
// }
public function fire(Job $job, $data)
{
// $this->oQueueJob->init($job);
//
$logId = isset($data['log_id']) ? intval($data['log_id']) : 0;
// if ($logId <= 0) {
// $this->oQueueJob->log("PromotionPrepareEmail 无效的 log_id删除任务");
// $job->delete();
// return;
// }
//
// try {
$service = new PromotionService();
$service->log("id:".$logId);
// $result = $service->prepareSingleEmail($logId);
//
// $code = isset($result['code']) ? $result['code'] : '';
// $msg = isset($result['msg']) ? $result['msg'] : '';
// $llm = isset($result['llm_status']) ? $result['llm_status'] : '';
// $this->oQueueJob->log("PromotionPrepareEmail 完成 | log_id={$logId} code={$code} llm_status={$llm} msg={$msg}");
$result = $service->prepareSingleEmail($logId);
$job->delete();
// } catch (\Exception $e) {
// $this->oQueueJob->handleException($e, $job, "log_id={$logId}");
// } catch (\Throwable $e) {
// $this->oQueueJob->handleException($e, $job, "log_id={$logId}");
// } finally {
// $this->oQueueJob->finnal();
// }
}
}