更新商户入驻

This commit is contained in:
yaooo 2023-09-14 16:51:51 +08:00
parent c3b8014bbd
commit 1e7aff1527

View File

@ -46,9 +46,10 @@ class MerchantIntention extends BaseController
return app('json')->fail('未开启商户入驻');
}
if ($this->userInfo) $data['uid'] = $this->userInfo->uid;
if ($this->userInfo->phone && ($this->userInfo->phone != ($data['phone'] ?? ''))) {
if (($this->userInfo->phone ?? false) && ($this->userInfo->phone != ($data['phone'] ?? ''))) {
throw new ValidateException('联系电话和注册手机不一致');
}
$intentionInfo = Db::name('merchant_intention')->where('social_credit_code', $data['social_credit_code'])->where('status', '<>', 2)->find();
if ($intentionInfo) {
throw new ValidateException('此统一社会信用代码已申请商户');
@ -136,7 +137,7 @@ class MerchantIntention extends BaseController
if (!systemConfig('mer_intention_open')) {
return app('json')->fail('未开启商户入驻');
}
if ($this->userInfo->phone && ($this->userInfo->phone != ($data['phone'] ?? ''))) {
if (($this->userInfo->phone ?? false) && ($this->userInfo->phone != ($data['phone'] ?? ''))) {
throw new ValidateException('联系电话和注册手机不一致');
}
$intentionInfo = Db::name('merchant_intention')->where('social_credit_code', $data['social_credit_code'])->where('status', '<>', 2)->find();