Merge branch 'dev_raining' of https://git.trustie.net/jacknudt/trustieforge into dev_raining

This commit is contained in:
huang 2017-02-23 14:13:47 +08:00
commit 6f06fde7dc
1 changed files with 1 additions and 1 deletions

View File

@ -143,7 +143,7 @@ class ForumsController < ApplicationController
reorder(order).
preload(:author, {:last_reply => :author}).
all
@forums = Forum.reorder("topic_count desc,updated_at desc")
@forums = Forum.find_by_sql("SELECT *,topic_count + memo_count tm FROM `forums` order by tm desc;")
@my_forums_count = Memo.where("author_id =? and parent_id is null", User.current.id).count
@my_memos_count = Memo.where("author_id =? and parent_id is not null", User.current.id).count
@errors = params[:errors]