From dcfd801ea435c1c87ed47f2ee24cdabaaf230d6f Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 31 三月 2020 12:15:56 +0800 Subject: [PATCH] 大淘客商品过滤修改 --- fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java index eb786f4..b79d920 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/BrandShopAdminController.java @@ -114,7 +114,6 @@ try { List<BrandClass> list = brandClassService.listQuery((pageIndex - 1) * pageSize, pageSize, key, state); - if (list == null || list.size() == 0) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁")); return; @@ -526,7 +525,7 @@ */ @RequestMapping(value = "queryBrand") public void queryBrand(String callback, Integer pageIndex, Integer pageSize, String key, Long cid, Integer state, - PrintWriter out) { + Integer showState, PrintWriter out) { if (pageIndex == null || pageIndex < 1) { pageIndex = 1; @@ -536,8 +535,19 @@ pageSize = Constant.PAGE_SIZE; } + List<String> keys = null; + if (!StringUtil.isNullOrEmpty(key)) { + String[] array = key.split("\\s+"); + if (array != null && array.length > 0) { + keys = new ArrayList<String>(); + for (int i= 0; i < array.length; i++) { + keys.add(array[i].toString()); + } + } + } + try { - List<BrandInfo> list = brandInfoService.listQuery((pageIndex - 1) * pageSize, pageSize, key, cid, state); + List<BrandInfo> list = brandInfoService.listQuery((pageIndex - 1) * pageSize, pageSize, keys, cid, state, showState); if (list == null || list.size() == 0) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁")); @@ -554,7 +564,7 @@ } } - long count = brandInfoService.countQuery(key, cid, state); + long count = brandInfoService.countQuery(keys, cid, state, showState); int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage); -- Gitblit v1.8.0