FormatMenuPath.php 991 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. declare (strict_types=1);
  3. namespace app\command;
  4. use app\common\repositories\system\auth\MenuRepository;
  5. use think\console\Command;
  6. use think\console\Input;
  7. use think\console\Output;
  8. /**
  9. * Class FormatMenuPath
  10. * @package app\command
  11. * @author zfy
  12. * @day 2020/8/26
  13. */
  14. class FormatMenuPath extends Command
  15. {
  16. /**
  17. * @author zfy
  18. * @day 2020/8/26
  19. */
  20. protected function configure()
  21. {
  22. // 指令配置
  23. $this->setName('menu:format')
  24. ->setDescription('the format menu command');
  25. }
  26. /**
  27. * @param Input $input
  28. * @param Output $output
  29. * @return int|void|null
  30. * @author zfy
  31. * @day 2020/8/26
  32. */
  33. protected function execute(Input $input, Output $output)
  34. {
  35. $output->writeln('开启修复');
  36. $menuRepository = app()->make(MenuRepository::class);
  37. $menuRepository->formatPath(0);
  38. $menuRepository->formatPath(1);
  39. $output->writeln('执行成功');
  40. }
  41. }