logistic_number = $logistic_number; } /** * Execute the job. * * @return void */ public function handle() { LogService::log(LogisticAliJiSuSync::class, "{$this->logistic_number}-JOB-AliJiSu", ''); //标记上有同步的操作 OrderPackage::query()->where('logistic_number', $this->logistic_number)->update(['sync_routes_flag'=> true]); $this->logisticAliJiSuApiService = app('LogisticAliJiSuApiService'); $response = $this->logisticAliJiSuApiService->query($this->logistic_number); $format = $this->logisticAliJiSuApiService->format($response,$this->logistic_number); try { $this->orderPackageReceivedSyncService = app('OrderPackageReceivedSyncService'); if (count($format) > 0 && $format['logistic_number'] ?? false) $this->orderPackageReceivedSyncService->update([$format]); } catch (\Exception $e) { app('LogService')->log(__METHOD__, __FUNCTION__, "阿里极速数据同步快递数据 ERROR " . ' || ' . json_encode($this->logistic_number) . ' || ' . json_encode($e->getMessage()) . ' || ' . json_encode($e->getTraceAsString())); } } }