26 lines
747 B
PHP
26 lines
747 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace app\common\command;
|
||
|
|
|
||
|
|
use app\common\job\OrderJob;
|
||
|
|
use think\Console;
|
||
|
|
use think\console\Command;
|
||
|
|
use think\console\Input;
|
||
|
|
use think\console\Output;
|
||
|
|
use think\Queue;
|
||
|
|
|
||
|
|
class Test extends Command
|
||
|
|
{
|
||
|
|
protected function configure()
|
||
|
|
{
|
||
|
|
$this->setName('test2')->setDescription('Here is the remark ');
|
||
|
|
}
|
||
|
|
|
||
|
|
protected function execute(Input $input, Output $output)
|
||
|
|
{
|
||
|
|
// $output->writeln("TestCommand:");
|
||
|
|
// Queue::push(OrderJob::class, $data = ['order_no' => 888888888], $queue = null); //前者是立即执行
|
||
|
|
// Queue::later(10, OrderJob::class, $data = ['order_no' => 999999999999], $queue = null); //在$delay秒后执行
|
||
|
|
$result = Console::call('bidding:deal', [], $output);
|
||
|
|
}
|
||
|
|
}
|