学院统计的学生数

dev_aliyun
cxt 5 years ago
parent dd5d3f9a51
commit a79bc50c5a

@ -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,

Loading…
Cancel
Save