| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\Jobs;
- use App\Order;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Bus\Dispatchable;
- use Illuminate\Queue\InteractsWithQueue;
- /**
- * @Deprecated 订单生成物流单
- */
- class OrderCreateWaybill implements ShouldQueue
- {
- use Dispatchable, InteractsWithQueue, Queueable;
- private $arr;
- /**
- * Create a new job instance.
- *
- * @return void
- */
- public function __construct(array $arr)
- {
- $this->arr = $arr;
- }
- /**
- * Execute the job.
- *
- * @return void
- */
- public function handle()
- {
- if (!$this->arr)return;
- $codes = array_column($this->arr,"code");
- $orders = Order::query()->with("logistic")->where("code",$codes)->get();
- foreach ($orders as $order) app("WaybillService")->createDbBill($order);
- }
- }
|