贴吧详情统计数修改

This commit is contained in:
huang 2016-12-30 20:14:31 +08:00
parent 1ece9cb185
commit 82a3ff01ef
1 changed files with 2 additions and 2 deletions

View File

@ -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)