diff --git a/app/services/create_watch_video_service.rb b/app/services/create_watch_video_service.rb index c7b3bb3bb..8a9bb7f08 100644 --- a/app/services/create_watch_video_service.rb +++ b/app/services/create_watch_video_service.rb @@ -38,9 +38,9 @@ class CreateWatchVideoService < ApplicationService end 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| d.start_at = current_time d.duration = params[:duration]