过期课程去掉再次购买的

This commit is contained in:
wuchunlei
2025-06-13 17:53:08 +08:00
parent c4104efc37
commit 6ffae79272

View File

@@ -30,6 +30,8 @@ public class PsycheCourseController {
private UserVipService userVipService;
@Autowired
private UserCourseStudyingService userCourseStudyingService;
@Autowired
private UserCourseBuyService userCourseBuyService;
//我的课程-全部
@@ -88,7 +90,12 @@ public class PsycheCourseController {
List<Map<String,Object>> list = courseService.listMaps(wrapper);
for (Map<String,Object> courseEntity : list) {
if (!userVipService.isPsycheVip(ShiroUtils.getUId())){
courseEntities.add(courseEntity);
int ucb = userCourseBuyService.count(new LambdaQueryWrapper<UserCourseBuyEntity>()
.eq(UserCourseBuyEntity::getUserId,ShiroUtils.getUId())
.eq(UserCourseBuyEntity::getCatalogueId,courseEntity.get("catalogueId")));
if (ucb == 0) {
courseEntities.add(courseEntity);
}
}
}
return R.ok().put("courseList",courseEntities);