查询分类下是否存在商品,去除掉已删除商品

This commit is contained in:
lifenlong 2021-06-18 16:22:49 +08:00
parent cbcadc21a2
commit c20f3ff04d

View File

@ -96,6 +96,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
public final Integer getGoodsCountByCategory(String categoryId) {
QueryWrapper queryWrapper = Wrappers.query();
queryWrapper.like("category_path", categoryId);
queryWrapper.eq("delete_flag", false);
return this.count(queryWrapper);
}