修复/user/courses 接口category_id参数过滤报错

This commit is contained in:
none
2023-05-08 17:08:35 +08:00
parent dbae07de95
commit af913bf4e4
3 changed files with 13 additions and 11 deletions

View File

@@ -237,11 +237,10 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
if (tmpCourseIds == null || tmpCourseIds.size() == 0) {
return new ArrayList<>();
}
// 取交集
courseIds.retainAll(tmpCourseIds);
}
if (courseIds.size() == 0) {
return new ArrayList<>();
courseIds = courseIds.stream().filter(tmpCourseIds::contains).toList();
if (courseIds.size() == 0) {
return new ArrayList<>();
}
}
return list(query().getWrapper().in("id", courseIds).eq("is_show", 1));
}