优化留言速度
This commit is contained in:
parent
7064e5b413
commit
fc19a468b7
|
@ -162,7 +162,7 @@ class JournalsForMessage < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def reset_counters!
|
def reset_counters!
|
||||||
self.class.reset_counters!(self)
|
# self.class.reset_counters!(self)
|
||||||
end
|
end
|
||||||
def self.reset_counters! journals_for_messages
|
def self.reset_counters! journals_for_messages
|
||||||
# jfm_id = journals_for_messages.id.to_i
|
# jfm_id = journals_for_messages.id.to_i
|
||||||
|
|
|
@ -68,20 +68,13 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td class="center">
|
<td class="center">
|
||||||
<% if(journal.m_reply_count) %>
|
<% replys = JournalsForMessage.where(:m_parent_id=>journal.id) %>
|
||||||
<%case journal.jour_type %>
|
<% reply_count = replys.nil? ? 0:replys.count %>
|
||||||
<% when 'Principal' %>
|
<%case journal.jour_type %>
|
||||||
<%= link_to(journal.m_reply_count, feedback_path(journal.jour_id)) %>
|
<% when 'Principal' %>
|
||||||
<% when 'Course' %>
|
<%= link_to(reply_count, feedback_path(journal.jour_id)) %>
|
||||||
<%= link_to(journal.m_reply_count, course_feedback_path(journal.jour_id)) %>
|
<% when 'Course' %>
|
||||||
<% end %>
|
<%= link_to(reply_count, course_feedback_path(journal.jour_id)) %>
|
||||||
<% else %>
|
|
||||||
<%case journal.jour_type %>
|
|
||||||
<% when 'Principal' %>
|
|
||||||
<%= link_to(0, feedback_path(journal.jour_id)) %>
|
|
||||||
<% when 'Course' %>
|
|
||||||
<%= link_to(0, course_feedback_path(journal.jour_id)) %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue