shish 6 жил өмнө
parent
commit
d6159a084b

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

@@ -58,6 +58,9 @@ class ApplyController extends BaseController
 		$get['long'] = isset($get['longitude']) ? $get['longitude'] : '';
 		$get['lat'] = isset($get['latitude']) ? $get['latitude'] : '';
 		$introMerchantId = isset($get['introMerchantId']) && !empty($get['introMerchantId']) ? $get['introMerchantId'] : 0;
+		if (getenv('YII_ENV') == 'test') {
+			$introMerchantId = 12358;
+		}
 		if (empty($introMerchantId)) {
 			util::fail('目前仅开放邀请注册');
 		}
@@ -73,6 +76,10 @@ class ApplyController extends BaseController
 		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();
@@ -81,7 +88,7 @@ class ApplyController extends BaseController
 		$data = ['focus' => $focus, 'wxAliasName' => $wxAliasName];
 		util::success($data);
 	}
-
+	
 	//申请状态
 	public function actionApplyStatus()
 	{