mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 01:01:52 +08:00
【功能优化】优化商品列表页或者详情页会员价和限时优惠价,那个便宜展示那个
This commit is contained in:
parent
cb7634ecb4
commit
a9241cfbf4
@ -100,15 +100,22 @@ public class AppTradeOrderController {
|
||||
skuList.forEach(sku -> {
|
||||
//查询限时优惠价格
|
||||
AppTradeProductSettlementRespVO.Sku skuDiscount = calculateDiscountPrice(sku.getId(), sku.getPrice());
|
||||
if(skuDiscount != null){
|
||||
skus.add(skuDiscount);
|
||||
}
|
||||
|
||||
//查询会员价
|
||||
AppTradeProductSettlementRespVO.Sku skuVip = calculateVipPrice(sku.getId(), sku.getPrice(), memberLevel);
|
||||
if(skuVip != null){
|
||||
|
||||
if(skuDiscount != null && skuVip != null){
|
||||
if(skuDiscount.getPrice() > skuVip.getPrice()){
|
||||
skus.add(skuDiscount);
|
||||
}else{
|
||||
skus.add(skuVip);
|
||||
}
|
||||
}else if(skuDiscount != null){
|
||||
skus.add(skuDiscount);
|
||||
}else if(skuVip != null){
|
||||
skus.add(skuVip);
|
||||
}
|
||||
|
||||
});
|
||||
AppTradeProductSettlementRespVO.Reward reward = calculateReward(spuId);
|
||||
AppTradeProductSettlementRespVO respVO = AppTradeProductSettlementRespVO.builder().id(spuId).skus(skus).build();
|
||||
|
Loading…
Reference in New Issue
Block a user