1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Console\Commands;
- use App\DataApi\Helper\IotGoodsOrderHelper;
- use App\DataApi\Helper\IotPackageHelper;
- use Illuminate\Console\Command;
- use Illuminate\Support\Facades\Log;
- class payOrderClean extends Command
- {
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'pay_order:clean';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = 'pay_order clean';
- /**
- * Execute the console command.
- *
- * @return int
- */
- public function handle()
- {
- (new IotGoodsOrderHelper())->clearIotGoodsOrder();
- (new IotPackageHelper())->clearIotPackageOrder();
- Log::info('定时任务:执行完成清除待支付订单,等待下次执行');
- $i = 0;
- while ($i < 600) {
- sleep(1);
- $i++;
- }
- $this->handle();
- }
- }
|