@ -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,
(SELECTcount(c.id)FROMcoursesc,membersm,member_rolesmrWHEREc.id!=1309andm.course_id=c.idANDm.id=mr.member_idANDmr.role_idin(3,7,9)andc.school_id=#{@school.id} AND m.user_id=users.id AND c.is_delete = 0) as course_count
FROM`users`,user_extensionsuewhereusers.id=ue.user_idandue.identity=0andue.school_id=#{@school.id} ORDER BY publish_shixun_count desc, course_count desc, id desc LIMIT 10")