shish hace 6 años
padre
commit
c725a12b3c
Se han modificado 2 ficheros con 8 adiciones y 15 borrados
  1. 0 12
      app/shop/controllers/ApplyController.php
  2. 8 3
      biz/saas/classes/ApplyClass.php

+ 0 - 12
app/shop/controllers/ApplyController.php

@@ -68,18 +68,6 @@ class ApplyController extends BaseController
 		if (empty($mobile)) {
 			util::fail('请填写正确手机号');
 		}
-		$apply = ApplyClass::getByCondition(['mobile' => $mobile]);
-		if (!empty($apply)) {
-			util::fail('手机号已被使用');
-		}
-		$apply = ApplyClass::getByCondition(['adminId' => $this->adminId]);
-		if (!empty($apply)) {
-			util::fail('您已经申请过了');
-		}
-		$adminShop = AdminShopService::getByCondition(['adminId' => $this->adminId]);
-		if (!empty($adminShop)) {
-			util::fail('您已经有门店了');
-		}
 		$admin = AdminService::getById($this->adminId);
 		ApplyService::addApply($get);
 		$wxBase = WxBaseService::getWxBase();

+ 8 - 3
biz/saas/classes/ApplyClass.php

@@ -2,6 +2,7 @@
 
 namespace biz\saas\classes;
 
+use biz\admin\classes\AdminShopClass;
 use common\components\sms;
 use common\components\stringUtil;
 use common\components\util;
@@ -21,11 +22,15 @@ class ApplyClass extends BaseClass
 		}
 		$apply = self::getByCondition(['mobile' => $mobile]);
 		if (!empty($apply)) {
-			util::fail('您已经申请过了');
+			util::fail('手机号已被使用');
 		}
-		$apply = self::getByCondition(['userId' => $data['userId']]);
+		$apply = self::getByCondition(['adminId' => $data['adminId']]);
 		if (!empty($apply)) {
-			util::fail('您已经申请过了');
+			util::fail('您已申请过了');
+		}
+		$adminShop = AdminShopClass::getByCondition(['adminId' => $data['adminId']]);
+		if (!empty($adminShop)) {
+			util::fail('您已经有门店了');
 		}
 		$prefix = $data['province'] == $data['city'] ? $data['province'] : $data['province'] . $data['city'];
 		$dist = isset($data['dist']) ? $data['dist'] : '';