diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index 5f1f094c..fab83063 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -128,7 +128,7 @@ class CollegesController < ApplicationController # 在线课堂 def course_statistics @courses = Course.find_by_sql("SELECT c.id, (select concat(lastname,firstname) from users u where u.id=c.tea_id) as username, - (select count(sfc.id) from students_for_courses sfc where c.id=sfc.course_id group by c.id) as student_count, + (select count(cm.id) from course_members cm where c.id=cm.course_id and cm.role=4 group by c.id) as student_count, (select count(hc.id) from homework_commons hc where c.id=hc.course_id and hc.homework_type=4 group by c.id) as hcm_count, (select count(hc.id) from homework_commons hc where c.id=hc.course_id and hc.homework_type in (1,3) group by c.id) as hcm_nonshixun_count, (select count(e.id) from exercises e where c.id=e.course_id group by c.id) as exercises_count,