vip优惠商品添加用户是否vip判断
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user