实践课程首页分组问题

dev_local_scyd
daiao 5 years ago
parent 47ad43e799
commit ce9389c2fe

@ -30,7 +30,7 @@ class SubjectsController < ApplicationController
if search
subjects = subjects.where("subjects.name like ?", "%#{search}%")
end
@subjects = subjects.select("subjects.*, sum(shixuns.myshixuns_count) AS myshixun_member_count").group_by("subjects.id").order("myshixun_member_count DESC")
@subjects = subjects.select("subjects.*, sum(shixuns.myshixuns_count) AS myshixun_member_count").group("subjects.id").order("myshixun_member_count DESC")
else
# 我的路径
if reorder == "mine"

Loading…
Cancel
Save