```
feat(shopro_huifu): 添加汇付地区编码转换和银行支行查询功能 - 新增 HuifuOnboardAreaHelper::toHuifuCityCode 方法,将区县级编码转换为地级市编码 - 新增 HuifuOnboardBankBranch::findByBranchCode 方法,支持按联行号精确查找银行信息 - 在业务开通流程中使用地区编码转换方法确保汇付银行卡信息正确 - 在验证器中添加根据联行号自动填充省市信息的功能 - 修复区域ID为空时省份ID的自动推导逻辑 ```
这个提交包含在:
@@ -264,6 +264,40 @@ class HuifuOnboardBankBranch
|
||||
return substr($cityCode, 0, 2) . '0000';
|
||||
}
|
||||
|
||||
/**
|
||||
* 按联行号精确查找(用于手动填联行号时回填省市)
|
||||
*/
|
||||
public static function findByBranchCode($branchCode)
|
||||
{
|
||||
$branchCode = trim((string) $branchCode);
|
||||
if ($branchCode === '') {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
$row = Db::name('shopro_huifu_bank_branch')
|
||||
->where('status', 1)
|
||||
->where('branch_code', $branchCode)
|
||||
->find();
|
||||
if ($row) {
|
||||
return [
|
||||
'branch_code' => (string) $row['branch_code'],
|
||||
'branch_name' => (string) $row['branch_name'],
|
||||
'bank_name' => (string) ($row['bank_name'] ?? ''),
|
||||
'prov_id' => (string) ($row['prov_id'] ?? ''),
|
||||
'area_id' => (string) ($row['area_id'] ?? ''),
|
||||
];
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
// ignore
|
||||
}
|
||||
foreach (self::loadJson() as $item) {
|
||||
if ((string) ($item['branch_code'] ?? '') === $branchCode) {
|
||||
return $item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected static function loadJson()
|
||||
{
|
||||
if (self::$jsonCache !== null) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户