From c9ab412c787f478d7689bb5c0aaad7478887a1b7 Mon Sep 17 00:00:00 2001 From: guyue <1721849008@qq.com> Date: 星期五, 05 九月 2025 14:05:33 +0800 Subject: [PATCH] 平台筛选2 --- src/main/java/com/linghu/service/impl/PlatformServiceImpl.java | 33 ++++++++++++++++----------------- 1 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/linghu/service/impl/PlatformServiceImpl.java b/src/main/java/com/linghu/service/impl/PlatformServiceImpl.java index 141b850..cff0029 100644 --- a/src/main/java/com/linghu/service/impl/PlatformServiceImpl.java +++ b/src/main/java/com/linghu/service/impl/PlatformServiceImpl.java @@ -128,24 +128,23 @@ if (!platForm.isEmpty()){ queryWrapper.in(Platform::getPlatform_id, platForm); } - if (page != null && pageSize != null && type_id == null){ - Page<Platform> pageInfo = new Page<>(page, pageSize); - Page<Platform> result = this.page(pageInfo, queryWrapper); - return ResponseResult.success(new CustomPage<>(result)); - } else if (page != null && pageSize != null && type_id != null) { - Page<Platform> pageInfo = new Page<>(page, pageSize); - queryWrapper.eq(Platform::getType_id, type_id); - Page<Platform> result = this.page(pageInfo, queryWrapper); - return ResponseResult.success(new CustomPage<>(result)); + if (page != null && pageSize != null && type_id == null){ + Page<Platform> pageInfo = new Page<>(page, pageSize); + Page<Platform> result = this.page(pageInfo, queryWrapper); + return ResponseResult.success(new CustomPage<>(result)); + } else if (page != null && pageSize != null && type_id != null) { + Page<Platform> pageInfo = new Page<>(page, pageSize); + queryWrapper.eq(Platform::getType_id, type_id); + Page<Platform> result = this.page(pageInfo, queryWrapper); + return ResponseResult.success(new CustomPage<>(result)); - } else { - CustomPage<Platform> customPage = new CustomPage<>(new Page<>()); - customPage.setRecords(new ArrayList<>()); - customPage.setTotal(0); - return ResponseResult.success(customPage); - } - - + } else { + CustomPage<Platform> customPage = new CustomPage<>(new Page<>()); + List<Platform> list = this.list(queryWrapper); + customPage.setRecords(list); + customPage.setTotal(list.size()); + return ResponseResult.success(customPage); + } } -- Gitblit v1.7.1