左侧导航栏的视频数调整

courseware
cxt 5 years ago
parent 5d239201a0
commit 064d76f25c

@ -147,7 +147,7 @@ module CoursesHelper
when "online_learning"
course.shixuns.count
when "video"
course.course_videos.count + course.live_links.count
course.videos_count + course.live_links.count
end
end

@ -160,6 +160,11 @@ class Course < ApplicationRecord
students.find_by(user_id: user_id)&.course_group_name
end
def videos_count
course_videos.where(videos: {transcoded: true})
.or(course_videos.where(videos: {user_id: current_user.id}))
.or(course_videos.where(course_videos: {is_link: true}))
end
def teacher_group(user_id)
data =

Loading…
Cancel
Save