| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Console\Commands;
- use Illuminate\Console\Command;
- use App\Jobs\PaymentJob;
- use Illuminate\Support\Facades\Log;
- class PaymentTask extends Command
- {
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'payment_task';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = 'Command description';
- /**
- * Execute the console command.
- *
- * @return int
- */
- public function handle()
- {
- $this->info('启动支付订单状态更新循环任务...');
- Log::error('启动支付订单状态更新循环任务...'.now());
- // 首次启动任务
- PaymentJob::dispatch()->delay(now()->addSeconds(10));
-
- $this->info('任务已启动,将在支付订单状态更新后首次执行');
-
- return Command::SUCCESS;
- }
- }
|