diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseProductCategoryServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseProductCategoryServiceImpl.java index 651162e3..63a0691a 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseProductCategoryServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseProductCategoryServiceImpl.java @@ -231,11 +231,12 @@ public class ShopBaseProductCategoryServiceImpl extends BaseServiceImpl getCategoryTree() { QueryWrapper queryWrapper = new QueryWrapper<>(); String redisKey = RedisConstant.Product_Cate_Key; + Integer store_id =0; if (getCurrentUser().isStore()) { - Integer store_id = Convert.toInt(getCurrentUser().getStore_id()); - queryWrapper.eq("store_id", store_id); - redisKey = RedisConstant.Product_Cate_Key + ":" + store_id; + store_id = Convert.toInt(getCurrentUser().getStore_id()); } + queryWrapper.eq("store_id", store_id); + redisKey = RedisConstant.Product_Cate_Key + ":" + store_id; List cateTree = Convert.toList(Map.class, redisService.get(redisKey)); if (CollUtil.isNotEmpty(cateTree)) { return cateTree;