From c45ea864ca0042bbab2ee338e2968c93505d978b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 19 Jul 2019 09:16:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8A=A5=E5=90=8D=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E7=9C=81=E7=95=A5=E5=8F=B7=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/competitions/enroll.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 %> From 4cb4280c25b4b99c87c4519c475719088e3476f2 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 19 Jul 2019 09:56:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AD=A6=E9=99=A2=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=A1=B5=E7=9A=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/colleges_controller.rb | 2 +- app/helpers/colleges_helper.rb | 9 +++++++++ app/views/colleges/_course_statistics.html.erb | 6 ++++-- app/views/colleges/statistics.html.erb | 7 ++++++- 4 files changed, 20 insertions(+), 4 deletions(-) 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 @@