diff --git a/src/main/java/com/peanut/modules/sociology/service/impl/CourseCatalogueChapterServiceImpl.java b/src/main/java/com/peanut/modules/sociology/service/impl/CourseCatalogueChapterServiceImpl.java index bd2bb9ec..46da6ca8 100644 --- a/src/main/java/com/peanut/modules/sociology/service/impl/CourseCatalogueChapterServiceImpl.java +++ b/src/main/java/com/peanut/modules/sociology/service/impl/CourseCatalogueChapterServiceImpl.java @@ -30,6 +30,7 @@ public class CourseCatalogueChapterServiceImpl extends ServiceImpl getCourseCatalogueChapterList(int id) { MPJLambdaWrapper wrapper = new MPJLambdaWrapper<>(); wrapper.selectAll(CourseCatalogueChapterEntity.class); + wrapper.select("if(MAX(t2.id)>0,1,0) AS isLearned "); wrapper.selectMax(UserCourseVideoPositionEntity::getId,CourseCatalogueChapterEntity::getIsLearned); wrapper.disableSubLogicDel().leftJoin(CourseCatalogueChapterVideoEntity.class,CourseCatalogueChapterVideoEntity::getChapterId,CourseCatalogueChapterEntity::getId); wrapper.disableSubLogicDel().leftJoin(UserCourseVideoPositionEntity.class,on->on.eq(UserCourseVideoPositionEntity::getVideoId,CourseCatalogueChapterVideoEntity::getId).eq(UserCourseVideoPositionEntity::getUserId,ShiroUtils.getUId()));