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

@@ -34,6 +34,8 @@ public class MedicalLabelAndMarketController {
private ShopProductService productService;
@Autowired
private com.peanut.modules.book.service.ShopProductService shopProductService;
@Autowired
private UserVipService userVipService;
/**
* 分类标签树
@@ -68,7 +70,7 @@ public class MedicalLabelAndMarketController {
Page<ShopProduct> page = productService.page(new Page<>(
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
for (ShopProduct shopProduct:page.getRecords()){
if (shopProduct.getIsVipPrice()==1){
if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
shopProduct.setVipPrice(shopProductService.getVipPrice(shopProduct));
}
}