问吧统计数字不一致的问题
This commit is contained in:
parent
faf43bb8ba
commit
fc5e335429
|
@ -144,8 +144,8 @@ class ForumsController < ApplicationController
|
|||
preload(:author, {:last_reply => :author}).
|
||||
all
|
||||
@forums = Forum.reorder("topic_count desc,updated_at desc")
|
||||
@my_forums_count = Forum.where(:creator_id => User.current.id).count
|
||||
@my_memos_count = Memo.where(:author_id => User.current.id).count
|
||||
@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]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -144,8 +144,8 @@ class MemosController < ApplicationController
|
|||
end
|
||||
|
||||
def edit
|
||||
@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 = 0
|
||||
@my_replies_count = Memo.where(:parent_id => @memo.id).count
|
||||
@forums = Forum.reorder("topic_count desc,updated_at desc")
|
||||
@replying = false
|
||||
respond_to do |format|
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
<div class="wenba-rightbar-li clearfix <%= i > 9 ? 'none' : ''%> " id="forum_list_<%= forum.id %>">
|
||||
<h4 class="fl wenba-rightbar-title mt5 ml10" style="border-bottom: 0px"><%= link_to forum.name, forum_path(forum), :class => "" %></h4>
|
||||
<ul class=" fl right-line wenba-rightbar-ul" >
|
||||
<li><%= link_to forum.topic_count, forum_path(forum), :class => "linkGrey5" %></li>
|
||||
<li><%= link_to forum.memo_count, forum_path(forum), :class => "linkGrey5" %></li>
|
||||
<li>回答</li>
|
||||
</ul>
|
||||
<ul class=" fl wenba-rightbar-ul" >
|
||||
<li><%= link_to forum.memo_count, forum_path(forum), :class => "linkGrey5" %></li>
|
||||
<li><%= link_to forum.topic_count, forum_path(forum), :class => "linkGrey5" %></li>
|
||||
<li>帖子</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue