From 6a748ce7b19b684b782d86f8cb6cdf53128199ad Mon Sep 17 00:00:00 2001 From: anke1460 Date: Tue, 17 Mar 2020 10:51:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E8=A7=86=E9=A2=91=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=8E=BB=E6=8E=89=E6=9C=AA=E5=BC=80=E5=A7=8B=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)