From 39c753fd2555340961ca7b15e403667829c81b94 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 16:54:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8D=E5=B8=88=E5=88=97=E8=A1=A8=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 6463bf854..27f24ebd0 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -183,7 +183,8 @@ module OrganizationsHelper end def excellent_teachers - User.where("excellent_teacher =?",true) + User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count + from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 and u.excellent_teacher =1 order by course_count desc") end end