he2802 3 gadi atpakaļ
vecāks
revīzija
a3f9329101

+ 4 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java

@@ -140,10 +140,11 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
     @Override
     public List<CourseUserChapterSectionVo> sectionList(CourseMenuQueryBo bo) {
         List<CourseUserChapterSectionVo> courseUserChapterSectionVos = courseChapterSectionMapper.sectionList(bo);
+        List<CourseUserChapterSectionVo> examList = courseChapterSectionMapper.examList(bo);
         if (!CollectionUtils.isEmpty(courseUserChapterSectionVos)) {
-            bo.setModuleId(courseUserChapterSectionVos.get(0).getModuleId());
-            bo.setChapterId(courseUserChapterSectionVos.get(0).getChapterId());
-            courseUserChapterSectionVos.addAll(courseChapterSectionMapper.examList(bo));
+            courseUserChapterSectionVos.addAll(examList);
+        }else{
+            courseUserChapterSectionVos = examList;
         }
         if (bo.getUserId() != null) {
             for (CourseUserChapterSectionVo courseMenuVo : courseUserChapterSectionVos) {