OrderCreateWaybill.php 885 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Jobs;
  3. use App\Order;
  4. use Illuminate\Bus\Queueable;
  5. use Illuminate\Contracts\Queue\ShouldQueue;
  6. use Illuminate\Foundation\Bus\Dispatchable;
  7. use Illuminate\Queue\InteractsWithQueue;
  8. /**
  9. * @Deprecated 订单生成物流单
  10. */
  11. class OrderCreateWaybill implements ShouldQueue
  12. {
  13. use Dispatchable, InteractsWithQueue, Queueable;
  14. private $arr;
  15. /**
  16. * Create a new job instance.
  17. *
  18. * @return void
  19. */
  20. public function __construct(array $arr)
  21. {
  22. $this->arr = $arr;
  23. }
  24. /**
  25. * Execute the job.
  26. *
  27. * @return void
  28. */
  29. public function handle()
  30. {
  31. if (!$this->arr)return;
  32. $codes = array_column($this->arr,"code");
  33. $orders = Order::query()->with("logistic")->where("code",$codes)->get();
  34. foreach ($orders as $order) app("WaybillService")->createDbBill($order);
  35. }
  36. }