@ -30,7 +30,7 @@ class SubjectsController < ApplicationController
ifsearch
subjects=subjects.where("subjects.name like ?","%#{search}%")
end
@subjects=subjects.select("subjects.*, sum(shixuns.myshixuns_count) AS myshixun_member_count").group("subjects.id").order("myshixun_member_count DESC")
@subjects=subjects.select("select subjects.*, sum(shixuns.myshixuns_count) AS myshixun_member_count").group("subjects.id").order("myshixun_member_count DESC")