vip优惠商品添加用户是否vip判断

This commit is contained in:
wuchunlei
2025-03-14 13:09:23 +08:00
parent 7eb3e58a18
commit 16f8166877
12 changed files with 26 additions and 22 deletions

View File

@@ -129,7 +129,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
.in(ShopProduct::getProductId, ids)
.orderByAsc(ShopProduct::getSort));
for (ShopProduct shopProduct : shopProductList) {
if (!userVipService.noVip()&&shopProduct.getIsVipPrice()==1){
if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
shopProduct.setVipPrice(shopProductService.getVipPrice(shopProduct));
}
}

View File

@@ -44,7 +44,7 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
wrapper.orderByAsc(ShopProductToSociologyMarket::getSort);
Page<ShopProduct> shopProductPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()), ShopProduct.class, wrapper);
for (ShopProduct shopProduct:shopProductPage.getRecords()){
if (shopProduct.getIsVipPrice()==1){
if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
shopProduct.setVipPrice(shopProductService.getVipPrice(shopProduct));
}
}
@@ -66,7 +66,7 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
public Map<String, Object> getProductDetail(Integer productId) {
ShopProduct product = this.getById(productId);
HashMap<String, Object> flag = new HashMap<>();
if (product.getIsVipPrice()==1){
if (userVipService.isVip()&&product.getIsVipPrice()==1){
product.setVipPrice(shopProductService.getVipPrice(product));
}
flag.put("detail",product);//基础信息
@@ -123,7 +123,7 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
List<ShopProduct> shopProducts = (List)flag.get("GLProducts");
if (shopProducts.size()>0){
for (ShopProduct shopProduct : shopProducts) {
if (!userVipService.noVip()&&shopProduct.getIsVipPrice()==1){
if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
shopProduct.setVipPrice(shopProductService.getVipPrice(shopProduct));
}
}