Browse Source

先注掉叫价

wangqifan 2 years ago
parent
commit
5422e83a2e

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

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