From f8da5fc23e9eae635c3e2f78957873d5535d140e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 14 Mar 2020 19:05:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E9=A1=B5=E6=8A=A5=E9=94=99?= 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 db45176b1..c74e4c9dd 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -114,7 +114,7 @@ class CoursesController < ApplicationController #sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})" #@videos = paginate videos.joins(sql).includes(video: [user: :user_extension], user: :user_extension) - videos = videos.joins(:video).select("course_videos.id, course_videos.title, course_videos.link, course_videos.user_id, course_videos.video_id") + videos = videos.joins(:video).select("course_videos.id, course_videos.title, course_videos.link, course_videos.is_link,course_videos.user_id, course_videos.video_id") videos = videos.where(videos: {transcoded: true}) .or(videos.where(videos: {user_id: current_user.id})) .or(videos.where(course_videos: {is_link: true})).includes(video: [user: :user_extension], user: :user_extension)