Test.php 747 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\common\command;
  3. use app\common\job\OrderJob;
  4. use think\Console;
  5. use think\console\Command;
  6. use think\console\Input;
  7. use think\console\Output;
  8. use think\Queue;
  9. class Test extends Command
  10. {
  11. protected function configure()
  12. {
  13. $this->setName('test2')->setDescription('Here is the remark ');
  14. }
  15. protected function execute(Input $input, Output $output)
  16. {
  17. // $output->writeln("TestCommand:");
  18. // Queue::push(OrderJob::class, $data = ['order_no' => 888888888], $queue = null); //前者是立即执行
  19. // Queue::later(10, OrderJob::class, $data = ['order_no' => 999999999999], $queue = null); //在$delay秒后执行
  20. $result = Console::call('bidding:deal', [], $output);
  21. }
  22. }