data = $data; } public function handle() { try { if(empty($this->data) || empty($this->data["data"])) { $this->delete(); return; } $data = $this->data["data"]; $array = json_decode($data,true); $content = $array["content"]; $adv_id = ""; if(! empty($content['adInfo'])){ $adInfo = json_decode($content['adInfo'],true); $adv_id = $adInfo['advId'] ?? ""; } $insert = [ 'crt_time' => time(), 'city' => $content['city'] ?? "", 'actionType' => $content["actionType"] ?? 0, 'acquireTime' => $content["acquireTime"] ?? "", 'clueType' => $content["clueType"] ?? 0, 'product' => $content["product"] ?? "", 'wechat' => $content["wechat"] ?? "", 'clueId' => $content["clueId"] ?? "", 'transformType' => $content["transformType"] ?? "", 'clueSource' => $content["clueSource"] ?? "", 'clueSourceId' => $content["clueSourceId"] ?? "", 'customerName' => $content["customerName"] ?? "", 'platform' => $content["platform"] ?? 0, 'ipLocationCity' => $content["ipLocationCity"] ?? "", 'phone' => $content["phone"] ?? "", 'isRepeatClue' => $content["isRepeatClue"] ?? 0, 'flowType' => $content["flowType"] ?? 0, 'fromUserId' => $array["fromUserId"] ?? "", 'adv_id' => $adv_id, ]; CustomerFromThreePlatForm::insert($insert); } catch (\Throwable $e) { Log::error('Queue error:', ['exception' => $e->getMessage() . '|' . $e->getLine()]); $this->delete(); } } protected function echoMessage(OutputInterface $output) { //输出消息 $output->writeln(json_encode($this->data)); } }