瀏覽代碼

客户申请

shish 5 年之前
父節點
當前提交
e53c097f04

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

@@ -63,8 +63,8 @@ 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);
+		$post['certType'] = ApplyClass::CERT_TYPE_LICENSE;
+		ApplyService::addNewApply($post);
 		util::complete();
 	}
 	

+ 2 - 2
app/ghs/controllers/CustomController.php

@@ -72,7 +72,7 @@ class CustomController extends BaseController
 		$post['from'] = ApplyClass::FROM_GHS;
 		$post['introSjId'] = $this->sjId;
 		$post['introStyle'] = MerchantClass::STYLE_SUPPLIER;
-		$post['certType'] = ApplyExtendClass::CERT_TYPE_MOBILE;
+		$post['certType'] = ApplyClass::CERT_TYPE_MOBILE;
 		$mobile = $post['mobile'] ?? '';
 		$confirmMobile = $post['confirmMobile'];
 		if (stringUtil::isMobile($mobile) == false) {
@@ -81,7 +81,7 @@ class CustomController extends BaseController
 		if ($mobile != $confirmMobile) {
 			util::fail('二次号码填写不一致');
 		}
-		ApplyService::addApply($post);
+		ApplyService::addNewApply($post);
 		util::complete('添加成功,等待审核');
 	}
 

+ 1 - 1
app/shop/controllers/ApplyController.php

@@ -69,7 +69,7 @@ class ApplyController extends BaseController
 		if (stringUtil::isMobile($post['mobile']) == false) {
 			util::fail('请填写正确手机号');
 		}
-		ApplyService::addApply($post);
+		ApplyService::addNewApply($post);
 		util::complete();
 	}
 	

+ 6 - 1
biz/saas/classes/ApplyClass.php

@@ -24,7 +24,12 @@ class ApplyClass extends BaseClass
 	const STATUS_UN_PASS = 3;
 	const STATUS_HAS_PAY = 4;
 	const STATUS_EXPIRE = 5;
-
+	
+	//证件类型
+	const CERT_TYPE_LICENSE = 1;
+	const CERT_TYPE_PERSON = 2;
+	const CERT_TYPE_MOBILE = 3;
+	
 	//添加申请 shish 2020.2.10
 	public static function addApply($data)
 	{

+ 0 - 5
biz/saas/classes/ApplyExtendClass.php

@@ -15,11 +15,6 @@ class ApplyExtendClass extends BaseClass
 
     public static $baseFile = '\biz\saas\models\ApplyExtend';
 
-	//证件类型
-    const CERT_TYPE_LICENSE = 1;
-	const CERT_TYPE_PERSON = 2;
-	const CERT_TYPE_MOBILE = 3;
-
     public static function getExtendByIds($ids)
     {
         $list = self::getAllByCondition(['applyId' => ['in', $ids]], null, '*', 'applyId');

+ 5 - 5
biz/saas/services/ApplyService.php

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

+ 5 - 1
sql.sql

@@ -1263,4 +1263,8 @@ ADD COLUMN `shopNo`  varchar(100) NOT NULL DEFAULT '' COMMENT '门店' AFTER `ap
 
 ========
 == shish 2021-2-25
-需要琦海配好线上的wss以及确认HTTP_ORIGIN限制问题
+需要琦海配好线上的wss以及确认HTTP_ORIGIN限制问题
+
+ALTER TABLE xhApply ADD `licenseNo` VARCHAR(30) NOT NULL DEFAULT '' COMMENT '营业执照号码' AFTER `name`;
+ALTER TABLE xhApply ADD `certType` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '证件类型 1营业执照 2身份证号 3手机号' AFTER `licenseNo`;
+ALTER TABLE xhApplyExtend DROP COLUMN `certType`;