diff --git a/app/models/user.rb b/app/models/user.rb index 8b5951687..63811cd58 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -269,7 +269,8 @@ class User < Principal forge_count = ForgeMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count - messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count = SystemMessage.where("created_at >?", User.current.onclick_time.onclick_time).count + messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count end # 查询指派给我的缺陷记录 diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index ec2e4b748..b70eabd5c 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -6,8 +6,6 @@
  • <%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %>
  • <%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %>
  • <%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "resourcesGrey" %>
  • - <%# 系统消息 %> -
  • <%= link_to "系统消息", user_message_path(User.current, :type => 'system_message'), :class => "resourcesGrey" %>
  • <%# 课程相关消息 %>
  • <%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %>
  • <%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %>
  • @@ -26,6 +24,8 @@
  • <%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "resourcesGrey" %>
  • <%# 系统贴吧 %>
  • <%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "resourcesGrey" %>
  • + <%# 系统消息 %> +
  • <%= link_to "系统消息", user_message_path(User.current, :type => 'system_message'), :class => "resourcesGrey" %>
  • @@ -104,6 +104,23 @@
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> + <% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 %> + + <% end %> <% if ma.course_message_type == "Poll" %>