From 3cec847e3b9b9a0f03ffc63b2a7536a28de6c173 Mon Sep 17 00:00:00 2001 From: jasder Date: Sat, 27 Apr 2019 16:34:47 +0800 Subject: [PATCH] =?UTF-8?q?ADD=20=E5=AD=A6=E9=99=A2=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E2=80=9C=E8=AF=BE=E5=A0=82=E2=80=9D?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=BF=9B=E8=A1=8C=E7=8A=B6=E6=80=81=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E6=8E=92=E5=BA=8F(=E6=AD=A3=E5=9C=A8=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E6=8E=92=E5=89=8D=E9=9D=A2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/colleges_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index 9f7b42e6..df500de8 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -140,6 +140,7 @@ class CollegesController < ApplicationController course[:task_count] = course.hcm_count.to_i + course.attachments_count.to_i + course.messages_count.to_i + course.hcm_nonshixun_count.to_i + course.exercises_count.to_i + course.polls_count.to_i end @courses = @courses.sort{|x,y| [y[:evaluating_count], y[:task_count]] <=> [x[:evaluating_count], x[:task_count]] } + @courses = @courses.sort_by { |course| course.is_end ? 1 : 0 } # SELECT c.id, (select concat(firstname,lastname) 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,