|
|
@ -40,7 +40,7 @@ class CreateWatchVideoService < ApplicationService
|
|
|
|
# 开始播放时记录一次
|
|
|
|
# 开始播放时记录一次
|
|
|
|
if params[:course_id].present?
|
|
|
|
if params[:course_id].present?
|
|
|
|
# 课堂视频
|
|
|
|
# 课堂视频
|
|
|
|
course_video = CourseVideo.find_by(course_id: params[:course_id], video_id: params[:video_id])
|
|
|
|
course_video = CourseVideo.find_by(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]
|
|
|
|