animeService = $animeService; } /** * Execute the console command. * * @return int */ public function handle() { dLog('command')->info('====================开始检查产品图片生成任务状态===================='); $time_start = microtime(true); $stats = $this->animeService->checkProductPicTasks(); // 兼容:检查任务中心中 saveScriptProducts 类型的任务是否完成,完成则更新状态和结果 $taskCenterUpdated = $this->animeService->checkSaveScriptProductTaskCenters(); $time_end = microtime(true); $this->info('检查完成: ' . json_encode($stats, JSON_UNESCAPED_UNICODE)); if ($taskCenterUpdated > 0) { $this->info('任务中心saveScriptProducts任务更新: ' . $taskCenterUpdated . ' 条'); } dLog('command')->info('产品图片生成任务检查完成', [ 'stats' => $stats, 'task_center_updated' => $taskCenterUpdated, 'cost_time' => round($time_end - $time_start, 2) ]); dLog('command')->info('====================结束检查产品图片生成任务状态===================='); return 0; } }