This commit is contained in:
gzlv
2021-07-16 18:27:44 +08:00
parent 538abaa5d5
commit 4bb0b522dc
4 changed files with 89 additions and 17 deletions

View File

@ -272,10 +272,10 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
wrapper.orderByAsc(YxStoreProduct::getPrice);
}
wrapper.orderByDesc(YxStoreProduct::getSort);
//无其他排序条件时,防止因为商品排序导致商品重复
if (StringUtils.isNullOrEmpty(productQueryParam.getPriceOrder()) && StringUtils.isNullOrEmpty(productQueryParam.getSalesOrder())) {
wrapper.orderByDesc(YxStoreProduct::getId);
wrapper.orderByDesc(YxStoreProduct::getSort);
}
Page<YxStoreProduct> pageModel = new Page<>(productQueryParam.getPage(),
productQueryParam.getLimit());