he2802 1 год назад
Родитель
Сommit
ad8c9de177

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java

@@ -69,7 +69,7 @@ public interface ICourseService extends IService<Course> {
     List<GoodsPeriodVo> listGoodsPeriodVo(UserPlanQueryBo bo);
 
 	List<GoodsPeriodStatusVo> listSection(ClassGradeUserQueryBo bo);
-	
+
 
     boolean editRebuild(ClassGradeUserQueryBo bo);
 

+ 9 - 2
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -737,6 +737,7 @@
         g.goods_name,
         g.`year`,
         g.`code`,
+          g.`status` as goods_status,
         g.class_hours,
         g.study_start_time,
         g.study_end_time,
@@ -757,9 +758,9 @@
         JOIN question_module_chapter a on e.major_id = a.module_exam_id LEFT JOIN question_chapter_exam h on
         a.chapter_exam_id = h.chapter_exam_id where e.goods_id = g.goods_id and e.type=1) FROM goods_attached a where
         a.goods_id=g.goods_id and a.type = 3) as exam_num,
-        (SELECT create_time FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
+        (SELECT create_time FROM user_exam_record r where r.order_goods_id=s.order_goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
         create_time ASC LIMIT 1) as start_time,
-        (SELECT create_time FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
+        (SELECT update_time FROM user_exam_record r where r.order_goods_id=s.order_goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
         create_time DESC LIMIT 1) as end_time,
         (SELECT COUNT(DISTINCT exam_id) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId})
         as stu_all_num
@@ -787,6 +788,12 @@
         <if test="goodsStatus != null and goodsStatus != '' ">
             and g.`status` = #{goodsStatus}
         </if>
+        <if test="status != null and status.size()!=0 ">
+            AND g.status in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="studyStartTime != null and studyStartTime != '' ">
             and (SELECT count(*) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} AND r.create_time >= #{studyStartTime} )>0
         </if>