查询商品列表是增加库存大于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

@@ -110,6 +110,7 @@ public class ShopProductLabelController {
shopProductEntityMPJLambdaWrapper.eq(ShopProductToLabelEntity::getSplId,splId);
shopProductEntityMPJLambdaWrapper.eq(ShopProductToLabelEntity::getDelFlag,0);
shopProductEntityMPJLambdaWrapper.eq(ShopProduct::getDelFlag,0);
shopProductEntityMPJLambdaWrapper.gt(ShopProduct::getProductStock,0);
Page<ShopProduct> shopProductEntityPage = shopProductToLabelDao.selectJoinPage(new Page<ShopProduct>(page, limit), ShopProduct.class, shopProductEntityMPJLambdaWrapper);
return R.ok().put("page",shopProductEntityPage);

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);
}