Browse Source

详情定价

Lgx 4 years ago
parent
commit
cb85c9c35a

+ 8 - 2
member-weixin-service/src/main/java/com/liangjian/dataplatform/member/service/impl/UserIngOrdersService.java

@@ -98,12 +98,18 @@ public class UserIngOrdersService implements IUserIngOrdersService {
             }
             //全部等级
             List<UserLevelUnit> userLevelUnits=userLevelUnitRepository.findAll();
-            for(UserLevelUnit userLevel : userLevelUnits){
+            for(int i=0;i<userLevelUnits.size();i++){
+                UserLevelUnit userLevel = userLevelUnits.get(i);
                 if(ingValue>=userLevel.getGrowthFrom() && ingValue<=userLevel.getGrowthTo()){
                     level=userLevel.getId();
                     break;
                 }else if(ingValue>0){
-                    level=userLevel.getId();
+                    if(ingValue>0&&ingValue<userLevelUnits.get(i).getGrowthFrom()){
+                        level=userLevelUnits.get(i-1).getId();
+                        break;
+                    }else {
+                        level = userLevel.getId();
+                    }
                 }
             }
         }