Bläddra i källkod

客户资料提交

shish 5 år sedan
förälder
incheckning
96b83e0484

+ 4 - 2
app/ghs/controllers/ApplyController.php

@@ -2,6 +2,7 @@
 
 namespace ghs\controllers;
 
+use biz\saas\classes\ApplyExtendClass;
 use bizTy\sj\classes\MerchantClass;
 use bizGhs\shop\services\ShopAdminService;
 use biz\saas\services\ApplyService;
@@ -17,7 +18,7 @@ use yii\web\Controller;
 
 class ApplyController extends BaseController
 {
-
+	
 	//邀请开店列表 shish 2021.1.28
 	public function actionList()
 	{
@@ -33,7 +34,7 @@ class ApplyController extends BaseController
 		$data = ApplyService::getApplyList($where);
 		util::success($data);
 	}
-
+	
 	//审核
 	public function actionCheck()
 	{
@@ -62,6 +63,7 @@ class ApplyController extends BaseController
 		$post['long'] = isset($post['longitude']) ? $post['longitude'] : '';
 		$post['lat'] = isset($post['latitude']) ? $post['latitude'] : '';
 		$post['from'] = ApplyClass::FROM_GHS;
+		$post['certType'] = ApplyExtendClass::CERT_TYPE_LICENSE;
 		ApplyService::addApply($post);
 		util::complete();
 	}

+ 0 - 4
app/ghs/controllers/CustomController.php

@@ -81,10 +81,6 @@ class CustomController extends BaseController
 		if ($mobile != $confirmMobile) {
 			util::fail('二次号码填写不一致');
 		}
-		$extend = ApplyExtendClass::getByCondition(['certType' => ApplyExtendClass::CERT_TYPE_MOBILE, 'mobile' => $mobile]);
-		if (!empty($extend)) {
-			util::fail('此客户已存在');
-		}
 		ApplyService::addApply($post);
 		util::complete('添加成功,等待审核');
 	}

+ 7 - 1
biz/saas/services/ApplyService.php

@@ -73,7 +73,7 @@ class ApplyService extends BaseService
 		$apply['adminName'] = $admin['adminName'] ?? '';
 		return MerchantClass::generateSj($apply);
 	}
-	
+
 	//申请开店 shish 2021.01.28
 	public static function addApply($data)
 	{
@@ -88,6 +88,12 @@ class ApplyService extends BaseService
 		if (stringUtil::isMobile($mobile) == false) {
 			util::fail('请填写正确手机号');
 		}
+		//查询客户提交的证件
+		$certType = $data['certType'] ?? ApplyExtendClass::CERT_TYPE_LICENSE;
+		$extend = ApplyExtendClass::getByCondition(['certType' => $certType, 'mobile' => $mobile]);
+		if (!empty($extend)) {
+			util::fail('此客户已存在');
+		}
 		$adminId = $data['adminId'] ?? 0;
 		$from = $data['from'] ?? 0;
 		if (in_array($from, [ApplyClass::FROM_GHS, ApplyClass::FROM_RETAIL]) == false) {