Просмотр исходного кода

feat: NG-15: 新会员注册时增加国家与语言选项.

zhangl 1 год назад
Родитель
Сommit
66bc887ab5

+ 1 - 1
common/models/DeclarationLevel.php

@@ -161,7 +161,7 @@ class DeclarationLevel extends \common\components\ActiveRecord
     }
 
     public static function getData(){
-        return static::find()->where('STATUS=1')->indexBy('ID')->orderBy('SORT ASC')->asArray()->all();
+        return static::find()->where('STATUS=1')->orderBy('SORT ASC')->asArray()->all();
     }
 
     public static function getNextDecLv($decLvID)

+ 8 - 11
frontendApi/modules/v1/controllers/UserController.php

@@ -594,17 +594,13 @@ SQL;
             $post['location'] = 1;
 
             // 针对于会员编号的判断
-            if($post['decType']=='normal'){ // 普通报单,判断Redis中的用户名是否一致
-                $insertUserName = strtoupper($post['insertUserName']);
-                $getRedisUserName = $redis->get('key_' . $insertUserName);
-                if (!$getRedisUserName){
-                    return static::notice(Yii::t('app', 'memberNumberExpired'), 400);
-                }
-                if ($insertUserName != $getRedisUserName){
-                    return static::notice(Yii::t('app', 'memberNumberDoesNotConformTo'), 400);
-                }
-            }else{ // BA升级,需要判断BA用户是否存在
-                $insertUserName = $post['insertUserName'];
+            $insertUserName = strtoupper($post['insertUserName']);
+            $getRedisUserName = $redis->get('key_' . $insertUserName);
+            if (!$getRedisUserName){
+                return static::notice(Yii::t('app', 'memberNumberExpired'), 400);
+            }
+            if ($insertUserName != $getRedisUserName){
+                return static::notice(Yii::t('app', 'memberNumberDoesNotConformTo'), 400);
             }
 
             $post['insertUserName'] = $insertUserName;
@@ -709,6 +705,7 @@ SQL;
             'decUserCurrencyRate' => $decUserCurrencyRate,
             'userCurrencyRate' => $currencyRate,
             'region' => $region,
+            'decLevel' => DeclarationLevel::getData()
         ]);
     }