diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index fab83063..cc4e6c9a 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -85,7 +85,7 @@ class CollegesController < ApplicationController homeworks = HomeworkCommon.where(:homework_type => 4, :course_id => course_ids.map(&:id)) un_shixun_work_count = homeworks.where("publish_time > '#{Time.now}' or publish_time is null").count shixun_work_count = homeworks.size - un_shixun_work_count - student_count = StudentsForCourse.where(:course_id => course_ids.map(&:id)).count + student_count = CourseMember.where(:course_id => course_ids.map(&:id), :role => 4).count myshixun_ids = StudentWork.select("myshixun_id").where("homework_common_id in (#{homeworks.map(&:id).join(',').strip == "" ? -1 : homeworks.map(&:id).join(',')}) and myshixun_id is not null") complete_myshixun = Myshixun.select("id").where(:status => 1, :id => myshixun_ids.map(&:myshixun_id)).size all_myshixun = Myshixun.select("id").where(:id => myshixun_ids.map(&:myshixun_id)).size