payOrderClean.php 955 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\DataApi\Helper\IotGoodsOrderHelper;
  4. use App\DataApi\Helper\IotPackageHelper;
  5. use Illuminate\Console\Command;
  6. use Illuminate\Support\Facades\Log;
  7. class payOrderClean extends Command
  8. {
  9. /**
  10. * The name and signature of the console command.
  11. *
  12. * @var string
  13. */
  14. protected $signature = 'pay_order:clean';
  15. /**
  16. * The console command description.
  17. *
  18. * @var string
  19. */
  20. protected $description = 'pay_order clean';
  21. /**
  22. * Execute the console command.
  23. *
  24. * @return int
  25. */
  26. public function handle()
  27. {
  28. (new IotGoodsOrderHelper())->clearIotGoodsOrder();
  29. (new IotPackageHelper())->clearIotPackageOrder();
  30. Log::info('定时任务:执行完成清除待支付订单,等待下次执行');
  31. $i = 0;
  32. while ($i < 600) {
  33. sleep(1);
  34. $i++;
  35. }
  36. $this->handle();
  37. }
  38. }