sendIotPackageOrder.php 873 B

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