change 3 سال پیش
والد
کامیت
6defaec21b

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java

@@ -2,6 +2,7 @@ package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.domain.CourseChapterSection;
@@ -132,6 +133,10 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
     @Override
     public List<CourseUserChapterSectionVo> sectionList(CourseMenuQueryBo bo) {
         List<CourseUserChapterSectionVo> courseUserChapterSectionVos = courseChapterSectionMapper.sectionList(bo);
+        if (!CollectionUtils.isEmpty(courseUserChapterSectionVos)) {
+            bo.setModuleId(courseUserChapterSectionVos.get(0).getModuleId());
+            bo.setChapterId(courseUserChapterSectionVos.get(0).getChapterId());
+        }
         courseUserChapterSectionVos.addAll(courseChapterSectionMapper.examList(bo));
         if (bo.getUserId() != null) {
             for (CourseUserChapterSectionVo courseMenuVo : courseUserChapterSectionVos) {

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml

@@ -128,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where 1=1
           and cme.chapter_id = #{chapterId}
         and cme.course_id = #{courseId}
+        and cme.module_id = #{moduleId}
     </select>
 
     <select id="getListTotalTime" parameterType="Long"  resultType="java.lang.Long">