每日上新 折扣
This commit is contained in:
parent
d09299d584
commit
8ce08d18a3
|
|
@ -65,15 +65,6 @@ public class HomePageService {
|
|||
* 销量榜
|
||||
*/
|
||||
List<HomeVO> homeVOs = productSkuMapper.selectSale();
|
||||
for (HomeVO o : homeVOs) {
|
||||
BigDecimal originPrice = o.getOriginPrice();
|
||||
if (originPrice.compareTo(BigDecimal.ZERO) != 0) {
|
||||
o.setDiscount(BigDecimalUtils.getDiscount(o.getOriginPrice(),o.getSalePrice()));
|
||||
} else {
|
||||
o.setDiscount(null);
|
||||
}
|
||||
}
|
||||
|
||||
HotRankingVO hotRankingVO = new HotRankingVO();
|
||||
hotRankingVO.setHotList(homeVOs);
|
||||
homeUpVO.setSalesList(hotRankingVO);
|
||||
|
|
@ -81,6 +72,14 @@ public class HomePageService {
|
|||
*每日榜
|
||||
*/
|
||||
List<HomeVO> homeVODay = productSkuMapper.selectDay();
|
||||
for (HomeVO o : homeVODay) {
|
||||
BigDecimal originPrice = o.getOriginPrice();
|
||||
if (originPrice.compareTo(BigDecimal.ZERO) != 0) {
|
||||
o.setDiscount(BigDecimalUtils.getDiscount(o.getOriginPrice(),o.getSalePrice()));
|
||||
} else {
|
||||
o.setDiscount(null);
|
||||
}
|
||||
}
|
||||
TodayRankingVO todayRankingVO = new TodayRankingVO();
|
||||
todayRankingVO.setTodayList(homeVODay);
|
||||
homeUpVO.setTodayList(todayRankingVO);
|
||||
|
|
|
|||
Loading…
Reference in New Issue