he2802 2 年之前
父節點
當前提交
383c9f276f
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

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

@@ -287,8 +287,7 @@
             and c.order_goods_id=#{orderGoodsId}
         </if>
         and c.user_id=#{userId} and c.status = 1 and c.goods_id = #{goodsId}) as record_num,
-        (SELECT SUM(cs.duration_time) from (select DISTINCT c.section_id FROM user_study_record c where 1=1
-        AND c.course_id = r.course_id
+        (SELECT IFNULL(SUM(cs.duration_time),0) from (select DISTINCT c.section_id,c.course_id FROM user_study_record c where 1=1
         and c.current_status=1
         <if test="gradeId != null and gradeId !=''">
             and c.grade_id=#{gradeId}
@@ -296,7 +295,7 @@
         <if test="orderGoodsId != null and orderGoodsId !=''">
             and c.order_goods_id=#{orderGoodsId}
         </if>
-        and c.user_id=#{userId} and c.status = 1 and c.goods_id = #{goodsId})cc LEFT JOIN  course_section cs on cc.section_id = cs.section_id) as record_time
+        and c.user_id=#{userId} and c.status = 1 and c.goods_id = #{goodsId})cc LEFT JOIN  course_section cs on cc.section_id = cs.section_id WHERE  cc.course_id = r.course_id) as record_time
         FROM
         course r
         LEFT JOIN goods_course c ON c.course_id = r.course_id