| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace App\Jobs;
- use App\Order;
- use App\Waybill;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Bus\Dispatchable;
- use Illuminate\Queue\InteractsWithQueue;
- /**
- * @Deprecated 订单与物流单关联
- */
- class HandleExceptionWaybill implements ShouldQueue
- {
- use Dispatchable, InteractsWithQueue, Queueable;
- /** @var Waybill|\stdClass */
- protected $waybill;
- /**
- * Create a new job instance.
- *
- * @param Waybill $waybill
- *
- * @return void
- */
- public function __construct(Waybill $waybill)
- {
- $this->waybill = $waybill;
- }
- /**
- * Execute the job.
- *
- * @return void
- *
- * @throws
- */
- public function handle()
- {
- $order = Order::query()->where("code",$this->waybill->wms_bill_number)->first();
- if ($order)$this->waybill->update(["order_id"=>$order->id]);
- else throw new \Exception("order does not exist");
- }
- }
|