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

+ 15 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -1384,7 +1384,21 @@
                cs.recording_url,
                cs.live_url,
                cs.live_start_time,
-               cs.live_end_time
+               cs.live_end_time,
+               ( SELECT
+                     IFNULL(COUNT(up.id),0)
+        FROM
+        user_period up
+        LEFT JOIN user_period_status ups ON up.id = ups.period_id
+        WHERE
+        up.grade_id =r.grade_id
+        AND up.user_id = #{userId}
+        AND up.module_id= r.module_id
+        and up.chapter_id=r.chapter_id
+        and up.course_id=r.course_id
+        and up.section_id=r.section_id
+        AND ups.period_status =1
+        and ups.record_end_time is not null) learning
         FROM (
                  SELECT from_unixtime(usr.update_time, '%Y-%m-%d') date,
         MAX( usr.update_time ) sort_time,