diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessBuyerUserController.java b/cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessBuyerUserController.java index f875f2e..69823d8 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessBuyerUserController.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessBuyerUserController.java @@ -176,8 +176,10 @@ public class BusinessBuyerUserController { @NoRepeatSubmit @ApiOperation(value = "搜索用户信息") @NoRepeatWebLog - public Result> searchUser(@RequestBody BusinessUserSearchParam param) { - Page page = cereBuyerUserService.searchUser(param); + public Result> searchUser(@RequestBody BusinessUserSearchParam param, HttpServletRequest request) { + //获取当前登录账户 + CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); + Page page = cereBuyerUserService.searchUser(String.valueOf(user.getBusinessId()), param); return new Result(page); } diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/dao/business/BusinessBuyerUserDAO.java b/cereshop-business/src/main/java/com/shop/cereshop/business/dao/business/BusinessBuyerUserDAO.java index 98daa5b..4632864 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/dao/business/BusinessBuyerUserDAO.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/dao/business/BusinessBuyerUserDAO.java @@ -63,4 +63,6 @@ public interface BusinessBuyerUserDAO extends BaseMapper { List getUserLabels(BusinessBuyerGetLabelsParam param); int increaseCredit(@Param("buyerUserId") long buyerUserId, @Param("credit") Integer credit); + + List getBuyerUserBySearch(String project, String searchContent); } diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/CereBusinessBuyerUserService.java b/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/CereBusinessBuyerUserService.java index 53df10a..47e1a01 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/CereBusinessBuyerUserService.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/CereBusinessBuyerUserService.java @@ -79,5 +79,5 @@ public interface CereBusinessBuyerUserService { * @param param * @return */ - Page searchUser(BusinessUserSearchParam param); + Page searchUser(String project, BusinessUserSearchParam param); } diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/impl/CereBusinessBuyerUserServiceImpl.java b/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/impl/CereBusinessBuyerUserServiceImpl.java index a52f994..40ac66c 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/impl/CereBusinessBuyerUserServiceImpl.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/impl/CereBusinessBuyerUserServiceImpl.java @@ -237,17 +237,17 @@ public class CereBusinessBuyerUserServiceImpl implements CereBusinessBuyerUserSe } @Override - public Page searchUser(BusinessUserSearchParam param) { + public Page searchUser(String project, BusinessUserSearchParam param) { PageHelper.startPage(param.getPage(),param.getPageSize()); - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + /* LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(CereBuyerUser::getBuyerUserId, param.getSearchKey()) .or() .eq(CereBuyerUser::getWechatOpenId, param.getSearchKey()) .or() .like(CereBuyerUser::getName, param.getSearchKey()) .or() - .eq(CereBuyerUser::getPhone, param.getSearchKey()); - List userList = businessBuyerUserDAO.selectList(wrapper); + .eq(CereBuyerUser::getPhone, param.getSearchKey());*/ + List userList = businessBuyerUserDAO.getBuyerUserBySearch(project, param.getSearchKey()); PageInfo pageInfo=new PageInfo<>(userList); Page page=new Page(pageInfo.getList(),pageInfo.getTotal()); return page; diff --git a/cereshop-business/src/main/resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml b/cereshop-business/src/main/resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml index f7d33a4..d89aee6 100644 --- a/cereshop-business/src/main/resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml +++ b/cereshop-business/src/main/resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml @@ -344,4 +344,8 @@ LEFT JOIN cere_platform_label b ON a.buyer_label_id=b.buyer_label_id where a.buyer_user_id=#{buyerUserId} + +