fix: 热销分组内容为空报错修复

This commit is contained in:
张松
2024-11-19 10:30:14 +08:00
parent 927bef9602
commit 55adcacc4c

View File

@@ -257,7 +257,12 @@ public class ProductService {
//热销
TbProductGroup hot = new TbProductGroup();
hot.setName("热销");
List<TbProduct> hots = tbProductMapper.selectHot(shopId,proSets);
List<TbProduct> hots = null;
if (proSets.isEmpty()) {
hots = new ArrayList<>();
}else {
hots = tbProductMapper.selectHot(shopId,proSets);
}
hot.setProducts(handleDate(hots,true,1,false, shopInfo));
groupList.add(0, hot);