changeHotTop.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\command;
  13. use crmeb\jobs\SyncProductTopJob;
  14. use think\console\Command;
  15. use think\console\Input;
  16. use think\console\Output;
  17. use think\facade\Queue;
  18. class changeHotTop extends Command
  19. {
  20. protected function configure()
  21. {
  22. // 指令配置
  23. $this->setName('change:hotTop')
  24. ->setDescription('清楚缓存:php think change:hotTop');
  25. }
  26. /**
  27. * 队列执行
  28. * @param Input $input
  29. * @param Output $output
  30. * @return int|void|null
  31. * @author Qinii
  32. * @day 4/24/22
  33. */
  34. protected function execute(Input $input, Output $output)
  35. {
  36. Queue::push(SyncProductTopJob::class,[]);
  37. $output->writeln('开始执行队列');
  38. }
  39. }