Browse Source

商家端商城和平台端商城对商品平台上架状态搜索业务的过滤处理

multiwx
dy-hu 7 months ago
parent
commit
559ec02fee
  1. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/param/index/SearchParam.java
  2. 1
      cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java
  3. 8
      cereshop-app/src/main/resources/mybatis/mapper/product/CereShopProductDAO.xml

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

1
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<Product> getSearchProducts(SearchParam param) throws CoBusinessException {
param.setProject(ContextUtil.getProject());
List<Product> result = cereShopProductDAO.getSearchProducts(param);
initProductLangInfo(result);
return result;

8
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
<if test="project == 0">
and a.plat_shelve_state=1
</if>
<if test="project!=0 and project != ''">
and a.shelve_state=1
</if>
<if test="search!=null and search!=''">
and a.product_name like concat('%',#{search},'%')
</if>

Loading…
Cancel
Save