diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index a6b05ea2b..006a2c3d3 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -208,8 +208,8 @@ class ForumsController < ApplicationController reorder(order). preload(:author, {:last_reply => :author}). all - @my_topic_count = Memo.where("author_id = #{User.current.id} and parent_id is null").count - @my_replies_count = Memo.where("author_id = #{User.current.id} and parent_id is not null").count + @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 @errors = params[:errors] # 推荐贴吧 @forums = Forum.where("id !=?", @forum.id).reorder("topic_count desc,updated_at desc").first(3) diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 02224063a..680f36b45 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -29,8 +29,6 @@ <% end %> - -