From 7131cd090ff524f20c8a6a5085b04cf9166b28a7 Mon Sep 17 00:00:00 2001 From: Himit_ZH <372347736@qq.com> Date: Thu, 29 Jul 2021 23:28:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hoj/controller/admin/AdminContestController.java | 12 ++++++------ .../hoj/controller/admin/AdminProblemController.java | 9 +++++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminContestController.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminContestController.java index 6649e491..f9730778 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminContestController.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminContestController.java @@ -243,12 +243,6 @@ public class AdminContestController { } } - if (!StringUtils.isEmpty(keyword)) { - problemQueryWrapper.and(wrapper -> wrapper.like("title", keyword).or() - .like("problem_id", keyword).or() - .like("author", keyword)); - } - // 根据oj筛选过滤 if (oj != null && !"All".equals(oj)) { if (!Constants.RemoteOJ.isRemoteOJ(oj)) { @@ -258,6 +252,12 @@ public class AdminContestController { } } + if (!StringUtils.isEmpty(keyword)) { + problemQueryWrapper.and(wrapper -> wrapper.like("title", keyword).or() + .like("problem_id", keyword).or() + .like("author", keyword)); + } + IPage problemList = problemService.page(iPage, problemQueryWrapper); HashMap contestProblem = new HashMap<>(); contestProblem.put("problemList", problemList); diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminProblemController.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminProblemController.java index 0d0d0955..4f4c669c 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminProblemController.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/admin/AdminProblemController.java @@ -69,8 +69,13 @@ public class AdminProblemController { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.orderByDesc("gmt_create"); - if (oj != null && oj.equals("Mine")) { - queryWrapper.eq("is_remote", false); + // 根据oj筛选过滤 + if (oj != null && !"All".equals(oj)) { + if (!Constants.RemoteOJ.isRemoteOJ(oj)) { + queryWrapper.eq("is_remote", false); + } else { + queryWrapper.eq("is_remote", true).likeRight("problem_id", oj); + } } if (auth != null && auth != 0) {