crmebCommand.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. namespace app\command;
  12. use think\console\Command;
  13. use think\console\Input;
  14. use think\console\input\Option;
  15. use think\console\Output;
  16. use think\Exception;
  17. use think\facade\Db;
  18. class crmebCommand extends Command
  19. {
  20. protected function configure()
  21. {
  22. $this->setName('cm_cli')
  23. ->setDescription('crmeb_merchant命令集');
  24. }
  25. /**
  26. * 获取所有可使用的命令
  27. * @param Input $input
  28. * @param Output $output
  29. * @return void
  30. * @author Qinii
  31. */
  32. protected function execute(Input $input, Output $output)
  33. {
  34. $context = '-------------------------------------------------------------------------------------------------------------- ' . PHP_EOL;
  35. $context .= $this->get_msage('php think menu','自动同步路由权限');
  36. $context .= $this->get_msage('php think spu','将所有商品加入到spu表');
  37. $context .= $this->get_msage('php think clear:attachment','清除缓存素材,(图片信息)');
  38. $context .= $this->get_msage('php think version:update','版本更新(代码升级/pc代码安装升级)');
  39. $context .= $this->get_msage('php think clear:merchant','清除所有[除配置相关之外]的数据');
  40. $context .= $this->get_msage('php think clear:redundancy','清除所有已删除的商户的商品相关数据');
  41. $context .= $this->get_msage('php think reset:password','重置平台管理员的密码:php think reset:password admin --pwd 123456');
  42. $context .= $this->get_msage('php think reset:imagePath','修改图片地址前缀: php think reset:imagePath http://old.com http://new.com');
  43. $context .= $this->get_msage('php think clear:cache','清除登录限制');
  44. $context .= $this->get_msage('php think change:hotTop','更新热卖榜单');
  45. $context .= $this->get_msage('php think update:city','更新城市数据:将需要导入的文件 addres.txt 文件放到项目目录下');
  46. $context .= $this->get_msage('php think createTool','根据数据表创建新的模块');
  47. $output->info('多商户可使用的命令:'.PHP_EOL.$context);
  48. }
  49. public function get_msage($name,$value)
  50. {
  51. $context = "\e[34m" . str_pad($name, 30, ' ', STR_PAD_RIGHT) .'| '. "\e[32m" . $value . "\e[0m \n";
  52. $context .= '-------------------------------------------------------------------------------------------------------------- '. PHP_EOL;
  53. return $context;
  54. }
  55. }