stores = $stores; } /** * Execute the job. * * @param StoreService $service * @return void * @throws */ public function handle(StoreService $service) { if (!$this->stores)return; $errors = []; foreach ($this->stores as $store){ try{ $service->createInstantBill($store); }catch (\Exception $e){ LogService::log(__METHOD__,"ERROR-入库生成即时账单",$store->toJson()." | ".$e->getMessage()); $errors = ["store_".$store->id.":".$e->getMessage()]; } } if ($errors)throw new \Exception(json_encode($errors)); } }