diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index 707255866..8e18ae2ad 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -105,7 +105,7 @@ class CollegesController < ApplicationController @courses = paginate courses course_ids = @courses.map(&:id) - @student_count = StudentsForCourse.where(course_id: course_ids).group(:course_id).count + @student_count = CourseMember.where(course_id: course_ids, role: 4).group(:course_id).count @shixun_work_count = HomeworkCommon.where(homework_type: 4, course_id: course_ids).group(:course_id).count @attachment_count = Attachment.where(container_id: course_ids, container_type: 'Course').group(:container_id).count @message_count = Message.joins(:board).where(boards: { parent_id: 0, course_id: course_ids }).group('boards.course_id').count