Przeglądaj źródła

水机分期相关修改

theo 2 lat temu
rodzic
commit
4e748c23cb

+ 2 - 2
common/messages/en-US/app.php

@@ -28,8 +28,8 @@ return [
     'insufficientInventory' => 'Insufficient inventory',
     'soldOut' => 'Sold out',
     'productsDoesNotExists' => 'Products does not exists!',
-    'allowOnlyOne' => '商品只能购买一个',
-    'canNotBuy' => '无法购买该商品',
+    'allowOnlyOne' => 'Only 1 can be purchased at a time',
+    'canNotBuy' => 'You should buy the product in order',
     'productsDoesSoldOut' => 'Products has sold out!',
     'cashDoesNotAdequate' => '余额不足,无法购买商品',
     'exchangePointDoesNotAdequate' => '兑换积分不足,无法购买商品',

+ 2 - 2
common/messages/zh-CN/app.php

@@ -28,8 +28,8 @@ return [
     'insufficientInventory' => '库存不足',
     'soldOut' => '已下架',
     'productsDoesNotExists' => '商品不存在',
-    'allowOnlyOne' => '商品只能购买一个',
-    'canNotBuy' => '无法购买该商品',
+    'allowOnlyOne' => '分期商品每次只可购买1个',
+    'canNotBuy' => '分期商品请按顺序购买',
     'productsDoesSoldOut' => '商品已下架',
     'cashDoesNotAdequate' => '余额不足,无法购买商品',
     'exchangePointDoesNotAdequate' => '兑换积分不足,无法购买商品',

+ 2 - 1
common/models/Instalment.php

@@ -47,7 +47,8 @@ class Instalment extends \common\components\ActiveRecord
     public static function getInfo($userId) {
         $userInfo = static::findOneAsArray("USER_ID = :USER_ID", [':USER_ID' => $userId]);
         if(!$userInfo){
-            return [];
+            return [
+            ];
         }
         return $userInfo;
     }

+ 7 - 7
frontendApi/modules/v1/controllers/UserController.php

@@ -287,17 +287,17 @@ class UserController extends BaseController {
             $userInfo['NEXT_PERF'] =  $nextLevelPerf;
             // 用户可选择的级别列表
             $userInfo['LEVEL_LIST'] = DeclarationLevel::getNextAll($levelPerf);// 用户可选择的级别列表
+            // 如果用户正处于报单分期中,则可以升级到Elite
+            $userInstalmentInfo = Instalment::getInfo($userId);
+            if($userInstalmentInfo){
+                if ($userInstalmentInfo['ORDER_TYPE']=='BD' && $userInstalmentInfo['STAGE'] < 3){
+                    $userInfo['LEVEL_LIST'] = DeclarationLevel::getNextAll(12);// 用户可选择的级别列表
+                }
+            }
             // 循环列表,补充升级所需要的补差
             foreach ($userInfo['LEVEL_LIST'] as &$v) {
                 $v['REPAIR_PV'] = $isObserve ? $v['PERF'] - $userInfo['NOW_PERF'] : $v['PERF'];
             }
-
-            // 如果用户正处于报单分期中,则可以升级到Elite
-            $userInstalmentInfo = Instalment::getInfo($userId);
-            if ($userInstalmentInfo['ORDER_TYPE']=='BD' && $userInstalmentInfo['STAGE'] < 3){
-                $userInfo['LEVEL_LIST'] = DeclarationLevel::getNextAll(12);// 用户可选择的级别列表
-
-            }
         }
 
         return static::notice(['baseInfo' => $userInfo]);