处理分页,处理虚拟销量,新增积分商品过滤

This commit is contained in:
朱耘稷
2021-02-03 10:49:16 +08:00
committed by xuwenbo
parent c193f1f328
commit 2e4051e53c

View File

@ -281,14 +281,14 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
productQueryParam.getLimit());
//分页处理
wrapper.last("limit "+(productQueryParam.getPage()-1)*productQueryParam.getLimit()+","+productQueryParam.getLimit());
//wrapper.last("limit "+(productQueryParam.getPage()-1)*productQueryParam.getLimit()+","+productQueryParam.getLimit());
IPage<YxStoreProduct> pageList = storeProductMapper.selectPage(pageModel, wrapper);
//处理虚拟销量
for (YxStoreProduct vo: pageList.getRecords()) {
vo.setSales(vo.getSales()+vo.getFicti());
}
// for (YxStoreProduct vo: pageList.getRecords()) {
// vo.setSales(vo.getSales()+vo.getFicti());
// }
List<YxStoreProductQueryVo> list = generator.convert(pageList.getRecords(), YxStoreProductQueryVo.class);
@ -416,7 +416,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
wrapper.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.eq(YxStoreProduct::getIsDel,ShopCommonEnum.DELETE_0.getValue())
.orderByDesc(YxStoreProduct::getSort);
wrapper.eq(YxStoreProduct::getIsIntegral,0);
// order
switch (ProductEnum.toType(order)) {
//精品推荐
@ -445,10 +445,10 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
IPage<YxStoreProduct> pageList = storeProductMapper.selectPage(pageModel, wrapper);
//处理虚拟销量
for (YxStoreProduct vo: pageList.getRecords()) {
vo.setSales(vo.getSales()+vo.getFicti());
}
//处理虚拟销量(sql已处理,去掉代码处理)
// for (YxStoreProduct vo: pageList.getRecords()) {
// vo.setSales(vo.getSales()+vo.getFicti());
// }
return generator.convert(pageList.getRecords(), YxStoreProductQueryVo.class);