课堂视频id

PCqiandao
anke1460 5 years ago
parent eddb444072
commit 60e087b0eb

@ -38,9 +38,9 @@ class CreateWatchVideoService < ApplicationService
end end
else else
# 开始播放时记录一次 # 开始播放时记录一次
if params[:course_id].present? if params[:course_video_id].present?
# 课堂视频 # 课堂视频
course_video = CourseVideo.find_by(params[:course_video_id]) course_video = CourseVideo.find(params[:course_video_id])
watch_course_video = WatchCourseVideo.find_or_initialize_by(course_video_id: course_video.id, user_id: user.id) do |d| watch_course_video = WatchCourseVideo.find_or_initialize_by(course_video_id: course_video.id, user_id: user.id) do |d|
d.start_at = current_time d.start_at = current_time
d.duration = params[:duration] d.duration = params[:duration]

Loading…
Cancel
Save