From 559ec02fee71d56e2be43284a9c39960d45f2b94 Mon Sep 17 00:00:00 2001 From: dy-hu Date: Wed, 26 Jun 2024 10:12:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=AE=B6=E7=AB=AF=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=92=8C=E5=B9=B3=E5=8F=B0=E7=AB=AF=E5=95=86=E5=9F=8E=E5=AF=B9?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=B9=B3=E5=8F=B0=E4=B8=8A=E6=9E=B6=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=90=9C=E7=B4=A2=E4=B8=9A=E5=8A=A1=E7=9A=84=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/shop/cereshop/app/param/index/SearchParam.java | 2 ++ .../app/service/product/impl/CereShopProductServiceImpl.java | 1 + .../main/resources/mybatis/mapper/product/CereShopProductDAO.xml | 8 +++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cereshop-app/src/main/java/com/shop/cereshop/app/param/index/SearchParam.java b/cereshop-app/src/main/java/com/shop/cereshop/app/param/index/SearchParam.java index 06b77d6..d8661ae 100644 --- a/cereshop-app/src/main/java/com/shop/cereshop/app/param/index/SearchParam.java +++ b/cereshop-app/src/main/java/com/shop/cereshop/app/param/index/SearchParam.java @@ -63,4 +63,6 @@ public class SearchParam extends PageParam { */ @ApiModelProperty(value = "最大价格") private BigDecimal maxMoney; + + private String project; } diff --git a/cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java b/cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java index 8c12f8c..f048901 100644 --- a/cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java +++ b/cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java @@ -863,6 +863,7 @@ public class CereShopProductServiceImpl implements CereShopProductService { @Override public List getSearchProducts(SearchParam param) throws CoBusinessException { + param.setProject(ContextUtil.getProject()); List result = cereShopProductDAO.getSearchProducts(param); initProductLangInfo(result); return result; diff --git a/cereshop-app/src/main/resources/mybatis/mapper/product/CereShopProductDAO.xml b/cereshop-app/src/main/resources/mybatis/mapper/product/CereShopProductDAO.xml index 505e6e8..18adb72 100644 --- a/cereshop-app/src/main/resources/mybatis/mapper/product/CereShopProductDAO.xml +++ b/cereshop-app/src/main/resources/mybatis/mapper/product/CereShopProductDAO.xml @@ -350,7 +350,13 @@ where a.product_id=b.product_id GROUP BY a.product_id) c ON a.product_id=c.product_id LEFT JOIN cere_platform_shop d ON a.shop_id=d.shop_id LEFT JOIN (SELECT SUM(number) number,sku_id,order_id from cere_order_product GROUP BY sku_id) f ON b.sku_id=f.sku_id - where a.shelve_state=1 and d.state=1 + where d.state=1 + + and a.plat_shelve_state=1 + + + and a.shelve_state=1 + and a.product_name like concat('%',#{search},'%')