修复过期课程查询有重复课程

This commit is contained in:
wuchunlei
2025-01-08 10:13:10 +08:00
parent 7b289f3a33
commit aa5f05edd0

View File

@@ -288,10 +288,10 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
List<Map<String,Object>> res = new ArrayList<>();
//如果过期又开通,去除
for (Map<String,Object> c : courseEntities) {
UserCourseBuyEntity ucb = userCourseBuyDao.selectOne(new LambdaQueryWrapper<UserCourseBuyEntity>()
int ucb = userCourseBuyDao.selectCount(new LambdaQueryWrapper<UserCourseBuyEntity>()
.eq(UserCourseBuyEntity::getUserId,param.get("userId"))
.eq(UserCourseBuyEntity::getCatalogueId,c.get("catalogueId")));
if (ucb == null) {
if (ucb == 0) {
res.add(c);
}
}