shish 6 years ago
parent
commit
a97ec31191
1 changed files with 9 additions and 8 deletions
  1. 9 8
      app/www/controllers/ApplyController.php

+ 9 - 8
app/www/controllers/ApplyController.php

@@ -54,14 +54,6 @@ class ApplyController extends BaseController
 		$get['userId'] = $this->userId;
 		$get['userId'] = $this->userId;
 		$get['long'] = isset($get['longitude']) ? $get['longitude'] : '';
 		$get['long'] = isset($get['longitude']) ? $get['longitude'] : '';
 		$get['lat'] = isset($get['latitude']) ? $get['latitude'] : '';
 		$get['lat'] = isset($get['latitude']) ? $get['latitude'] : '';
-		$apply = ApplyClass::getByCondition(['userId' => $this->userId]);
-		if (!empty($apply)) {
-			util::fail('您已经申请过了');
-		}
-		$admin = AdminService::getByCondition(['platUserId' => $this->userId]);
-		if (!empty($admin)) {
-			util::fail('您已经开店了,不能重复申请');
-		}
 		
 		
 		$cacheKey = 'OPEN_SHOP_APPLY_' . $userId;
 		$cacheKey = 'OPEN_SHOP_APPLY_' . $userId;
 		$cacheCode = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
 		$cacheCode = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
@@ -72,6 +64,15 @@ class ApplyController extends BaseController
 			util::fail('验证码错误');
 			util::fail('验证码错误');
 		}
 		}
 
 
+		$apply = ApplyClass::getByCondition(['userId' => $this->userId]);
+		if (!empty($apply)) {
+			util::fail('您已经申请过了');
+		}
+		$admin = AdminService::getByCondition(['platUserId' => $this->userId]);
+		if (!empty($admin)) {
+			util::fail('您已经开店了,不能重复申请');
+		}
+
 		ApplyService::addApply($get);
 		ApplyService::addApply($get);
 		if ($rand == 0) {
 		if ($rand == 0) {
 			$data = ['focus' => 0, 'qrCode' => 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3602624501,870193918&fm=26&gp=0.jpg'];
 			$data = ['focus' => 0, 'qrCode' => 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3602624501,870193918&fm=26&gp=0.jpg'];