修改后端

This commit is contained in:
Himit_ZH 2021-07-29 23:28:34 +08:00
parent 3690a0da74
commit 7131cd090f
2 changed files with 13 additions and 8 deletions

View File

@ -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<Problem> problemList = problemService.page(iPage, problemQueryWrapper);
HashMap<String, Object> contestProblem = new HashMap<>();
contestProblem.put("problemList", problemList);

View File

@ -69,8 +69,13 @@ public class AdminProblemController {
QueryWrapper<Problem> 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) {