diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index 418015fd..3cd61f51 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -67,7 +67,7 @@ class CollegesController < ApplicationController user_extensions.`school_id`=#{@school.id}) and work_status between 1 and 2 and myshixun_id !=0").first.try(:sw_count) @teachers = User.find_by_sql("SELECT users.id, users.login, users.lastname, users.firstname, users.nickname, IFNULL((SELECT count(shixuns.id) FROM shixuns where shixuns.user_id =users.id group by shixuns.user_id), 0) AS publish_shixun_count, - (SELECT count(c.id) FROM courses c, members m, member_roles mr WHERE m.course_id = c.id AND m.id=mr.member_id AND mr.role_id in (3,7,9) AND m.user_id=users.id AND c.is_delete = 0) as course_count + (SELECT count(c.id) FROM courses c, members m, member_roles mr WHERE c.id != 1309 and m.course_id = c.id AND m.id=mr.member_id AND mr.role_id in (3,7,9) AND m.user_id=users.id AND c.is_delete = 0) as course_count FROM `users`, user_extensions ue where users.id=ue.user_id and ue.identity=0 and ue.school_id=#{@school.id} ORDER BY publish_shixun_count desc, course_count desc, id desc LIMIT 10") # ).order("publish_shixun_count desc, experience desc").limit(10) @teachers = diff --git a/app/helpers/colleges_helper.rb b/app/helpers/colleges_helper.rb index 49a7fdc2..f7238ce6 100644 --- a/app/helpers/colleges_helper.rb +++ b/app/helpers/colleges_helper.rb @@ -14,4 +14,13 @@ module CollegesHelper end type end + + def course_managers teachers + str = "" + teachers.each_with_index do |teacher, index| + str += "、" if index > 0 + str += teacher.user.try(:show_real_name) + end + str + end end diff --git a/app/views/colleges/_course_statistics.html.erb b/app/views/colleges/_course_statistics.html.erb index d112c839..67e989f3 100644 --- a/app/views/colleges/_course_statistics.html.erb +++ b/app/views/colleges/_course_statistics.html.erb @@ -2,7 +2,7 @@
名称 | -创建教师 | +管理教师 | 评测次数 | 学生 | 实训作业 | @@ -16,7 +16,9 @@ <% @courses.each do |course| %>
---|---|---|---|---|---|
<%= course.name %> | -<%= course.username %> | ++ <%= course_managers course.teachers %> + | <%= course.evaluating_count %> | <%= course.student_count.to_i %> | <%= course.hcm_count.to_i %> | diff --git a/app/views/colleges/statistics.html.erb b/app/views/colleges/statistics.html.erb index 98c5be73..3c842539 100644 --- a/app/views/colleges/statistics.html.erb +++ b/app/views/colleges/statistics.html.erb @@ -100,7 +100,12 @@