fix 老师端视频统计

courseware
anke1460 5 years ago
parent 4ab0d9d506
commit 72706e0026

@ -35,7 +35,7 @@ class CourseVideosController < ApplicationController
@watch_course_videos = @watch_course_videos.where("course_members.course_group_id = ?", params[:group_id])
end
@watch_course_videos = @watch_course_videos.select("count(watch_course_videos.course_video_id) AS freq, watch_course_videos.*")
@watch_course_videos = @watch_course_videos.select("count(watch_course_videos.course_video_id) AS freq, watch_course_videos.id, watch_course_videos.user_id, watch_course_videos.start_at, watch_course_videos.end_at, watch_course_videos.is_finished, watch_course_videos.total_duration")
if params[:order].present?
key = params[:order].split("-")

@ -1,5 +1,6 @@
json.data do
json.array! @watch_course_videos do |d|
json.id d.id
json.user_name d.user&.real_name
json.is_finished d.is_finished ? true : false
json.total_duration d.total_duration.round(0)

Loading…
Cancel
Save