Browse Source

处理平台端、商家端会员打标签时查询标签过滤

multiwx
dy-hu 7 months ago
parent
commit
343e8001e8
  1. 2
      cereshop-admin/src/main/resources/mybatis/mapper/buyer/CereBuyerUserDAO.xml
  2. 5
      cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessBuyerUserController.java
  3. 6
      cereshop-business/src/main/java/com/shop/cereshop/business/param/buyer/BusinessBuyerGetLabelsParam.java
  4. 2
      cereshop-business/src/main/resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml

2
cereshop-admin/src/main/resources/mybatis/mapper/buyer/CereBuyerUserDAO.xml

@ -330,7 +330,7 @@
<select id="getLabels" parameterType="com.shop.cereshop.admin.param.buyer.BuyerGetLabelsParam" resultType="com.shop.cereshop.commons.domain.label.CerePlatformLabel">
SELECT buyer_label_id,label_name FROM cere_platform_label
where 1=1
where business_id=0
<if test="labelName!=null and labelName!=''">
and label_name like concat('%',#{labelName},'%')
</if>

5
cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessBuyerUserController.java

@ -108,7 +108,10 @@ public class BusinessBuyerUserController {
*/
@PostMapping(value = "getLabels")
@ApiOperation(value = "标签查询")
public Result<List<CerePlatformLabel>> getLabels(@RequestBody BusinessBuyerGetLabelsParam param) throws CoBusinessException{
public Result<List<CerePlatformLabel>> getLabels(@RequestBody BusinessBuyerGetLabelsParam param, HttpServletRequest request) throws CoBusinessException{
//获取当前登录账户
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user");
param.setBusinessId(user.getBusinessId());
List<CerePlatformLabel> list=cereBuyerUserService.getLabels(param);
return new Result(list);
}

6
cereshop-business/src/main/java/com/shop/cereshop/business/param/buyer/BusinessBuyerGetLabelsParam.java

@ -27,4 +27,10 @@ public class BusinessBuyerGetLabelsParam {
*/
@ApiModelProperty(value = "客户id")
private Long buyerUserId;
/**
* 商家id
*/
@ApiModelProperty(value = "商家id")
private Long businessId;
}

2
cereshop-business/src/main/resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml

@ -333,7 +333,7 @@
<select id="getLabels" parameterType="com.shop.cereshop.business.param.buyer.BusinessBuyerGetLabelsParam" resultType="com.shop.cereshop.commons.domain.label.CerePlatformLabel">
SELECT buyer_label_id,label_name FROM cere_platform_label
where 1=1
where business_id=#{businessId}
<if test="labelName!=null and labelName!=''">
and label_name like concat('%',#{labelName},'%')
</if>

Loading…
Cancel
Save