名师列表排序

This commit is contained in:
huang 2016-05-13 16:54:27 +08:00
parent 6ccb79a210
commit 39c753fd25
1 changed files with 2 additions and 1 deletions

View File

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