视频目录的调整

newyslclassrooms
cxt 5 years ago
parent 2aadeefe18
commit 65ccd40ed1

@ -102,8 +102,13 @@ class CoursesController < ApplicationController
end end
def course_videos def course_videos
logger.info("########[#{@course}")
videos = @course.videos videos = @course.videos
if params[:category_id].present? && params[:category_id].to_i != 0
videos = videos.where(course_second_category_id: params[:category_id].to_i)
end
@category = @main_category.course_second_categories.find_by(id: params[:category])
tip_exception("子目录id有误") if !@category.present?
videos = custom_sort(videos, params[:sort_by], params[:sort_direction]) videos = custom_sort(videos, params[:sort_by], params[:sort_direction])
@count = videos.count @count = videos.count
@videos = paginate videos.includes(user: :user_extension) @videos = paginate videos.includes(user: :user_extension)

@ -80,7 +80,7 @@ module CoursesHelper
when "statistics" when "statistics"
"/courses/#{course.id}/statistics" "/courses/#{course.id}/statistics"
when "video" when "video"
"/courses/#{course.id}/course_videos/#{mod.id}" "/courses/#{course.id}/course_videos"
end end
end end

Loading…
Cancel
Save