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

@@ -37,6 +37,8 @@ public class PsycheHomeController {
private ShopProductService shopProductService;
@Autowired
private com.peanut.modules.book.service.ShopProductService spService;
@Autowired
private UserVipService userVipService;
//获取标签列表
@RequestMapping("/getPsycheLabels")
@@ -83,7 +85,7 @@ public class PsycheHomeController {
Page<ShopProduct> shopProductPage = shopProductService.page(new Page<>(
Long.parseLong(params.get("page").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
for (ShopProduct shopProduct:shopProductPage.getRecords()){
if (shopProduct.getIsVipPrice()==1){
if (userVipService.isVip()&&shopProduct.getIsVipPrice()==1){
shopProduct.setVipPrice(spService.getVipPrice(shopProduct));
}
}