Merge branch 'yuanke_youhua' into develop

This commit is contained in:
yuanke 2016-11-04 14:55:26 +08:00
commit 3c81c4ccad
3 changed files with 15 additions and 16 deletions

View File

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

View File

@ -1205,6 +1205,12 @@ class User < Principal
#为新注册用户发送留言 #为新注册用户发送留言
def add_new_jour def add_new_jour
self.delay.add_new_jour_delay
end
#为新注册用户发送留言
def add_new_jour_delay
Rails.logger.info "add_new_jour_delay!!!!!!!!!"
if Setting.find_by_name("hidden_non_project") && Setting.find_by_name("hidden_non_project").value != "0" if Setting.find_by_name("hidden_non_project") && Setting.find_by_name("hidden_non_project").value != "0"
if Message.where("id=19504").any? and Message.where("id=19291").any? and Message.where("id=19292").any? if Message.where("id=19504").any? and Message.where("id=19291").any? and Message.where("id=19292").any?
lead_message1 = Message.find(19292) lead_message1 = Message.find(19292)

View File

@ -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) %>
<% reply_count = replys.nil? ? 0:replys.count %>
<%case journal.jour_type %> <%case journal.jour_type %>
<% when 'Principal' %> <% when 'Principal' %>
<%= link_to(journal.m_reply_count, feedback_path(journal.jour_id)) %> <%= link_to(reply_count, feedback_path(journal.jour_id)) %>
<% when 'Course' %> <% when 'Course' %>
<%= link_to(journal.m_reply_count, course_feedback_path(journal.jour_id)) %> <%= link_to(reply_count, course_feedback_path(journal.jour_id)) %>
<% end %>
<% 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>