消息报500

This commit is contained in:
cxt 2016-06-17 14:45:07 +08:00
parent a105f4eaf0
commit eb3694dbe6
2 changed files with 4 additions and 4 deletions

View File

@ -132,7 +132,7 @@ class UsersController < ApplicationController
# 未读的消息存放在数组
mess = message_all.message
if (message_all.message_type != "SystemMessage"&& !mess.nil? && (mess.viewed == 0 || !mess.viewed)) || (message_all.message_type == "SystemMessage"&& !mess.nil? && mess.created_at > onclick_time)
unless (message_all.message_type == 'CourseMessage' && mess && mess.course.is_delete == 1)
unless (message_all.message_type == 'CourseMessage' && mess && mess.course && mess.course.is_delete == 1)
@message_alls << mess
end
break if @message_alls.length == 5
@ -166,7 +166,7 @@ class UsersController < ApplicationController
messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user.id, "SystemMessage", "SystemMessage").includes(:message).order("created_at desc")
messages.each do |message_all|
mess = message_all.message
unless (message_all.message_type == 'CourseMessage' && mess && mess.course.is_delete == 1)
unless (message_all.message_type == 'CourseMessage' && mess && mess.course && mess.course.is_delete == 1)
@message_alls << mess
end
end
@ -177,7 +177,7 @@ class UsersController < ApplicationController
# 在点击或者刷新消息列表后未读的消息存放在数组
mess = message_all.message
if message_all.message_type != "SystemMessage"&& !mess.nil? && (mess.viewed == 0 || !mess.viewed)
unless (message_all.message_type == 'CourseMessage' && mess && mess.course.is_delete == 1)
unless (message_all.message_type == 'CourseMessage' && mess && mess.course && mess.course.is_delete == 1)
@message_alls << mess
end
end

View File

@ -326,7 +326,7 @@
</ul>
<% end %>
<% if ma.course_message_type == "StudentWorksScore" %>
<% if ma.course_message_type == "StudentWorksScore" && ma.course_message %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<% if ma.course_message.reviewer_role == 3 %>