From 72ff8804242357ab87b4bcb17058b20f52b224e4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 16 Dec 2016 20:19:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 ++-- app/views/users/course_community.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 562d133bb..0790696cc 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1820,7 +1820,7 @@ class UsersController < ApplicationController # 自己的主页显示消息 # 系统消息为管理员发送,我的消息中包含有系统消息 @message_alls = [] - messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user.id, "SystemMessage", "SystemMessage").includes(:message).order("created_at desc") + 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 && mess.course.is_delete == 1) @@ -2079,7 +2079,7 @@ class UsersController < ApplicationController @message_alls << mess end elsif (message_all.message_type == "AppliedMessage" ) - if (mess.applied_type == "AppliedProject" && mess.status == 1) || (mess.applied_type == "ApplyAddSchools" && mess.status == 0) + if (mess.applied_type == "AppliedProject" && mess.status == 1) || ( mess.applied_type == "ApplyAddSchools" && ApplyAddSchools.where(:school_id => mess.applied_id, :status => 0).count != 0 ) @message_alls << mess end elsif message_all.message_type == "CourseMessage" diff --git a/app/views/users/course_community.html.erb b/app/views/users/course_community.html.erb index 2a066c86b..eb82a09ba 100644 --- a/app/views/users/course_community.html.erb +++ b/app/views/users/course_community.html.erb @@ -1,7 +1,7 @@
-
消息动态
+
最新动态