wangqifan 2 years ago
parent
commit
98999f3f44

+ 2 - 2
src/main/java/com/izouma/nineth/service/nftdomain/CartService.java

@@ -35,8 +35,8 @@ public class CartService {
         User user = SecurityUtils.getAuthenticatedUser();
         Long userId = user.getId();
         int userLevel = user.getLevel();
-        int maxCount = 5 + userLevel / 10;
-        Long nowCount = (Long) collectionCartStatus().get("count");
+        int maxCount = 5 + (userLevel / 10) * 5;
+        Long nowCount = (Long) collectionCartStatus(userId).get("count");
         if ((nowCount.intValue()) + 1 > maxCount) {
             throw new BusinessException("已经超过当前用户等级购物车容量,当前" + userLevel + "级容量为" + maxCount);
         }