recordData = $recordData; } /** * Execute the job. * * @return void */ public function handle() { try { // 接收参数 $recordData = $this->recordData; // 切换数据 $result = (new DbService())->getConnectionNameByCompanyId($recordData['company_id']); // 错误提示 if( isset($result['error']) ) { // 返回结果 Log::error('join_live_enlist_jobs',$result['error'],$recordData); return 0; } unset($recordData['company_id']); // 查询 $result = (new Model())->add($recordData); // 返回结果 if( !$result ) Log::error('join_live_enlist_jobs','写入失败',$recordData); // 返回结果 return 0; } catch (\Throwable $th) { // 返回结果 Log::error('join_live_enlist_jobs',$th->getMessage(),$th); } } public function failed(\Throwable $th) { Log::info('join_live_enlist_jobs', '直播参与下单抽奖队列失败', ['data' => $this->recordData, 'error' => $th->getMessage()]); } }