回复报错

dev_local_scyd
daiao 5 years ago
parent 45bda3db4d
commit 263b6a48fe

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

@ -1,4 +1,4 @@
json.discuss do
json.(@discuss, :id, :created_at, :position, :shixun_id, :hidden, :reward, :praise_count)
json.(@discuss, :id, :created_at, :position, :hidden, :reward, :praise_count)
json.content content_safe(@discuss.content)
end

Loading…
Cancel
Save