过期课程去掉再次购买的
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user