feat: 新增师傅入驻审核与接单状态联动功能
- 新增师傅资质审核模块及权限 - 未审核通过的师傅默认禁用接单状态 - 新增售后退款申诉功能与相关界面 - 新增用户钱包管理及充值功能 - 更新服务定价矩阵相关数据库结构 - 修复微信支付证书验证问题
这个提交包含在:
@@ -148,6 +148,23 @@ class Merchant extends Backend
|
||||
if (Db::name('merchant')->where('user_id', $uid)->count() > 0) {
|
||||
$this->error('该用户账号已绑定企业商家主体,请勿重复创建');
|
||||
}
|
||||
// 统一社会信用代码唯一性校验,防止同一企业重复建档(兼容历史数据大小写差异)
|
||||
$licenseNo = strtoupper(trim((string)($params['license_no'] ?? '')));
|
||||
$licenseRaw = trim((string)($params['license_no'] ?? ''));
|
||||
if ($licenseNo !== '') {
|
||||
$dupLicense = Db::name('merchant')
|
||||
->where(function ($q) use ($licenseNo, $licenseRaw) {
|
||||
$q->where('license_no', $licenseNo)->whereOr('license_no', $licenseRaw);
|
||||
})
|
||||
->order('id', 'asc')
|
||||
->find();
|
||||
if ($dupLicense) {
|
||||
$this->error('统一社会信用代码已绑定企业【' . $dupLicense['name'] . '】,同一企业请勿重复建档');
|
||||
}
|
||||
}
|
||||
if ($licenseNo !== '') {
|
||||
$params['license_no'] = $licenseNo;
|
||||
}
|
||||
$params['order_count'] = 0;
|
||||
$params['total_amount'] = 0.00;
|
||||
if (($params['verify_status'] ?? '') === 'reject' && empty(trim((string)($params['audit_msg'] ?? '')))) {
|
||||
@@ -228,6 +245,24 @@ class Merchant extends Backend
|
||||
if (isset($params['verify_status']) && $params['verify_status'] === 'reject' && empty(trim((string)($params['audit_msg'] ?? '')))) {
|
||||
$this->error('驳回企业入驻时请填写审核驳回原因');
|
||||
}
|
||||
// 统一社会信用代码唯一性校验(排除自身,兼容历史数据大小写差异)
|
||||
if (array_key_exists('license_no', $params)) {
|
||||
$licenseNo = strtoupper(trim((string)$params['license_no']));
|
||||
$licenseRaw = trim((string)$params['license_no']);
|
||||
if ($licenseNo !== '') {
|
||||
$dupLicense = Db::name('merchant')
|
||||
->where('id', '<>', (int)$row['id'])
|
||||
->where(function ($q) use ($licenseNo, $licenseRaw) {
|
||||
$q->where('license_no', $licenseNo)->whereOr('license_no', $licenseRaw);
|
||||
})
|
||||
->order('id', 'asc')
|
||||
->find();
|
||||
if ($dupLicense) {
|
||||
$this->error('统一社会信用代码已绑定企业【' . $dupLicense['name'] . '】,同一企业请勿重复建档');
|
||||
}
|
||||
$params['license_no'] = $licenseNo;
|
||||
}
|
||||
}
|
||||
$result = false;
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
在新工单中引用
屏蔽一个用户