CanselOrder.php 998 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace App\Jobs\Cron;
  3. use App\Models\Order;
  4. use App\Services\Common\OrderService;
  5. use Illuminate\Bus\Queueable;
  6. use Illuminate\Queue\SerializesModels;
  7. use Illuminate\Queue\InteractsWithQueue;
  8. use Illuminate\Contracts\Queue\ShouldQueue;
  9. use Illuminate\Foundation\Bus\Dispatchable;
  10. use Illuminate\Support\Facades\Cache;
  11. use Illuminate\Support\Facades\DB;
  12. use Illuminate\Support\Facades\Log;
  13. class CanselOrder implements ShouldQueue
  14. {
  15. use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
  16. const CREATE_LIST = 'create';
  17. const UPDATE_LIST = 'update';
  18. /**
  19. * Create a new job instance.
  20. *
  21. * @return void
  22. */
  23. public function __construct()
  24. {
  25. }
  26. /**
  27. * Execute the job.
  28. *
  29. * @return void
  30. */
  31. public function handle(OrderService $orderService)
  32. {
  33. $order_id = $orderService->canselOrder();
  34. if($order_id){
  35. Order::whereIn('id', $order_id)->update(['is_pay'=>3]);
  36. }
  37. }
  38. }