From 82a3ff01ef406f9f3ae86a01ecf560b6ebb12412 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 30 Dec 2016 20:14:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E8=AF=A6=E6=83=85=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 63d8429ba..b24adcc2e 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -187,8 +187,8 @@ class ForumsController < ApplicationController reorder(order). preload(:author, {:last_reply => :author}). all - @my_topic_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is null").count - @my_replies_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is not null").count + @my_topic_count = Memo.where("forum_id = #{@memo.forum_id} and parent_id is null").count + @my_replies_count = Memo.where("forum_id = #{@memo.forum_id} and parent_id is not null").count @errors = params[:errors] # 推荐贴吧 @forums = Forum.where("id !=?", @forum.id).reorder("topic_count desc,updated_at desc").first(3)