setName('shopro_huifu:repair-menu') ->setDescription('Repair shopro_huifu install (files + SQL + menus)'); } protected function execute(Input $input, Output $output) { $shopro = \think\Db::name('auth_rule')->where('name', 'shopro')->find(); if (!$shopro) { $output->error('未找到 Shopro 父菜单 (auth_rule.name=shopro),请先安装 Shopro 商城插件'); return; } Installer::upgradeSchema($output); Installer::installMenu($output); Installer::installSplitMenu($output); \app\common\library\Menu::enable('shopro_huifu/config'); \app\common\library\Menu::enable('shopro/split'); Installer::grantRulesToShoproGroups($output); Installer::clearMenuCache(); Installer::setAddonState('shopro_huifu', 1, $output); $output->writeln('请退出后台重新登录,然后执行 php think shopro_huifu:verify 复查'); } }