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| %> - + 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 @@

在线实训情况

-
+ <% if @shixun_tags_name.size == 0 %> + <%= render :partial => 'welcome/no_data' %> +
+ <% else %> +
+ <% end %>
diff --git a/app/views/competitions/enroll.html.erb b/app/views/competitions/enroll.html.erb index 69bedd2f..ee439267 100644 --- a/app/views/competitions/enroll.html.erb +++ b/app/views/competitions/enroll.html.erb @@ -76,10 +76,10 @@ <% if team.teacher_id.present? %> <%= image_tag(url_to_avatar(team.teacher), :width => "26", :height => "26", :class => "radius fl mr4") %> <% end %> - <% team.team_members.where("user_id != #{team.teacher_id.present? ? team.teacher_id : '-1'}")[0, 9].each do |member| %> + <% team.team_members.where("user_id != #{team.teacher_id.present? ? team.teacher_id : '-1'}")[0, 8].each do |member| %> <%= link_to image_tag(url_to_avatar(member.user), :width => "20", :height => "20", :class => "radius fl mr5 mt3"), user_path(member.user), :title => member.user.show_name, :target => "_blank", :class => "fl", :alt => "用户头像" %> <% end %> - <% if team.team_members.size > 9 %> + <% if team.team_members.size > 8 %> <% end %>
名称创建教师管理教师 评测次数 学生 实训作业
<%= course.name %><%= course.username %> + <%= course_managers course.teachers %> + <%= course.evaluating_count %> <%= course.student_count.to_i %> <%= course.hcm_count.to_i %>