Explorar el Código

前期限制只有批发店邀请了才能注册

shish hace 11 meses
padre
commit
457efcd716
Se han modificado 1 ficheros con 10 adiciones y 4 borrados
  1. 10 4
      app-hd/controllers/ApplyController.php

+ 10 - 4
app-hd/controllers/ApplyController.php

@@ -128,6 +128,12 @@ class ApplyController extends BaseController
 
             $post = Yii::$app->request->post();
 
+            //前期限制只有批发店邀请了才能注册
+            $introShopId = $post['introShopId'] ?? 0;
+            if (empty($introShopId)) {
+                util::fail('请找批发店才能注册');
+            }
+
             $shopName = $post['name'] ?? '';
             if (empty($shopName)) {
                 util::fail('名称不能为空');
@@ -172,7 +178,7 @@ class ApplyController extends BaseController
             $cacheKey = 'register_mobile_code_' . $ptStyle . '_' . $mobile;
             $saveAuthCode = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
 
-            if($fillMobile == 1){
+            if ($fillMobile == 1) {
                 if ($authCode != 19640123) {
                     if (empty($saveAuthCode)) {
                         util::fail('请填写验证码哦');
@@ -184,10 +190,10 @@ class ApplyController extends BaseController
                         util::fail('验证码错误');
                     }
                 }
-            }else{
-                $cacheKey = 'getMobile_'.$mobile;
+            } else {
+                $cacheKey = 'getMobile_' . $mobile;
                 $hasGet = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
-                if(empty($hasGet)){
+                if (empty($hasGet)) {
                     util::fail('请获取手机');
                 }
             }