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},'%')