kevin 1 жил өмнө
parent
commit
61b63ea917

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

@@ -288,13 +288,15 @@ class UserController extends BaseController {
             // 用户可选择的级别列表
             $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);// 用户可选择的级别列表
-//                    unset($userInfo['LEVEL_LIST'][$userDecId]);
-//                }
-//            }
+            $userInstalmentInfo = Instalment::getInfo($userId);
+            if($userInstalmentInfo){
+                // 分期的总期数
+                $instalment = intval(Cache::getSystemConfig()['instalment']['VALUE'] ?? 3);
+                if ($userInstalmentInfo['ORDER_TYPE']=='BD' && $userInstalmentInfo['STAGE'] < $instalment){
+                    $userInfo['LEVEL_LIST'] = DeclarationLevel::getNextAll(12);// 用户可选择的级别列表
+                    unset($userInfo['LEVEL_LIST'][$userDecId]);
+                }
+            }
             // 循环列表,补充升级所需要的补差
             foreach ($userInfo['LEVEL_LIST'] as &$v) {
                 $v['REPAIR_PV'] = $isObserve ? $v['PERF'] - $userInfo['NOW_PERF'] : $v['PERF'];