From 51b5bd91f36f5ee358f5d73af5cc422ece7ee58f Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 13 Sep 2023 14:39:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E6=88=B7=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E5=8F=91=E5=B8=83=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/store/merchant/MerchantIntention.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index fc55dce3..4441a5dd 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -45,14 +45,18 @@ class MerchantIntention extends BaseController return app('json')->fail('未开启商户入驻'); } if ($this->userInfo) $data['uid'] = $this->userInfo->uid; - $newUid = Db::name('User')->where('account', $data['phone'])->value('uid', -1); - if ($newUid != -1 && $this->userInfo->uid != $newUid) { - //throw new ValidateException('该申请手机已存在账户,不可申请'); - } - $newMerid = Db::name('Merchant')->where('mer_phone', $data['phone'])->value('mer_id', -1); - if ($newMerid != -1) { - //throw new ValidateException('该申请手机已存在商户,不可申请'); + $merInfo = Db::name('merchant')->where('uid', $this->userInfo->uid)->where('status', 1)->find(); + if ($merInfo) { + throw new ValidateException('该用户已存在商户,不可申请'); } + // $newUid = Db::name('User')->where('account', $data['phone'])->value('uid', -1); + // if ($newUid != -1 && $this->userInfo->uid != $newUid) { + // //throw new ValidateException('该申请手机已存在账户,不可申请'); + // } + // $newMerid = Db::name('Merchant')->where('mer_phone', $data['phone'])->value('mer_id', -1); + // if ($newMerid != -1) { + // //throw new ValidateException('该申请手机已存在商户,不可申请'); + // } $make = app()->make(MerchantRepository::class); if ($make->fieldExists('mer_name', $data['mer_name'])) throw new ValidateException('商户名称已存在,不可申请');