瀏覽代碼

先注掉叫价

wangqifan 3 年之前
父節點
當前提交
5422e83a2e
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/main/java/com/izouma/nineth/service/nftdomain/CartService.java

+ 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);