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}"); $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(); // } } }