查询商品列表是增加库存大于0限制

This commit is contained in:
wuchunlei
2023-12-28 17:25:07 +08:00
parent cdb6cb79be
commit 078c001198
2 changed files with 4 additions and 1 deletions

View File

@@ -60,7 +60,9 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
Object name = params.get("name");
IPage<ShopProduct> page = this.page(
new Query<ShopProduct>().getPage(params),
new ExcludeEmptyQueryWrapper<ShopProduct>().like("product_name", params.get("key"))
new ExcludeEmptyQueryWrapper<ShopProduct>()
.gt("product_stock",0)
.like("product_name", params.get("key"))
);
return new PageUtils(page);
}