文件
xionggeshop/addons/shopro_huifu/command/RepairMenu.php
可乐加冰 8b35cfd568 ```
feat(shopro_huifu): 增加联行号表自动创建和结算费率配置功能

- 新增 install_bank_branch_table.sql 脚本用于独立创建联行号表
- 修改 ImportBankBranch 命令,当联行号表不存在时自动创建,无需手动执行 repair-menu
- 添加 upgradeSchema 方法支持独立运行数据库升级脚本
- 在配置界面新增 onboard_settle_fee_rate 字段,支持设置D1结算费率
- 更新 HuifuOnboardBusiOpen 类使用配置的结算费率参数
```
2026-09-30 14:01:38 +08:00

37 行
1.2 KiB
PHP

<?php
namespace addons\shopro_huifu\command;
use addons\shopro_huifu\library\Installer;
use think\console\Command;
use think\console\Input;
use think\console\Output;
class RepairMenu extends Command
{
protected function configure()
{
$this->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 复查');
}
}