diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 909f1c11d..f6868cfa2 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1547,7 +1547,7 @@ class CoursesController < ApplicationController def watch_statics course_videos = @course.course_videos.joins(:watch_course_videos).joins(" JOIN course_members ON course_members.user_id = watch_course_videos.user_id AND course_members.course_id = #{@course.id} AND role = 4 - ") + ").where("watch_course_videos.end_at IS NOT NULL") @total_duration = course_videos.sum(:total_duration).round(0) @frequencies = course_videos.joins("JOIN watch_video_histories ON watch_course_videos.id = watch_video_histories.watch_course_video_id").count(:id) @people_num = course_videos.count(:id)