过期课程
This commit is contained in:
@@ -156,6 +156,37 @@ public class CourseController {
|
|||||||
return R.ok().put("pageRes",pageRes);
|
return R.ok().put("pageRes",pageRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//我的课程-过期课程
|
||||||
|
@RequestMapping("/getCourseExpire")
|
||||||
|
public R getCourseExpire(){
|
||||||
|
List courseEntities = new ArrayList();
|
||||||
|
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
||||||
|
wrapper.distinct();
|
||||||
|
wrapper.leftJoin(CourseCatalogueEntity.class,CourseCatalogueEntity::getCourseId,CourseEntity::getId);
|
||||||
|
//关掉本次查询del_flg = 0的条件,查询过期课程
|
||||||
|
wrapper.disableSubLogicDel().rightJoin(UserCourseBuyEntity.class,UserCourseBuyEntity::getCatalogueId,CourseCatalogueEntity::getId);
|
||||||
|
wrapper.rightJoin(CourseToTaihumed.class,CourseToTaihumed::getCourseId,CourseEntity::getId);
|
||||||
|
wrapper.eq(UserCourseBuyEntity::getUserId,ShiroUtils.getUId());
|
||||||
|
wrapper.eq(UserCourseBuyEntity::getDelFlag,-1);
|
||||||
|
wrapper.selectAll(CourseEntity.class);
|
||||||
|
wrapper.selectAs(CourseCatalogueEntity::getId,"catalogueId");
|
||||||
|
wrapper.selectAs(CourseCatalogueEntity::getTitle,"catalogueTitle");
|
||||||
|
wrapper.orderByAsc(CourseEntity::getSort);
|
||||||
|
wrapper.orderByAsc(CourseCatalogueEntity::getSort);
|
||||||
|
List<Map<String,Object>> list = courseService.listMaps(wrapper);
|
||||||
|
for (Map<String,Object> courseEntity : list) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void topLael(List<Integer> list, int courseTaihumedId){
|
public void topLael(List<Integer> list, int courseTaihumedId){
|
||||||
CourseTaihumed courseTaihumed = courseTaihumedService.getById(courseTaihumedId);
|
CourseTaihumed courseTaihumed = courseTaihumedService.getById(courseTaihumedId);
|
||||||
if (courseTaihumed.getPid()==0){
|
if (courseTaihumed.getPid()==0){
|
||||||
|
|||||||
Reference in New Issue
Block a user