From 1a6f81f3020e585279a8164c760c5b6491f26091 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 9 Sep 2015 10:15:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=94=B3=E8=AF=B7=EF=BC=8C?= =?UTF-8?q?=E5=8C=BA=E5=88=86=E5=B7=B2=E8=AF=BB=E5=92=8C=E6=9C=AA=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 6 ++++++ app/controllers/users_controller.rb | 2 +- app/views/users/user_messages.html.erb | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 77933666f..04041bdf6 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -322,6 +322,12 @@ class ProjectsController < ApplicationController end def settings + # 修改查看消息状态 + applied_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type =? and viewed =?", User.current.id, @project, "AppliedProject", 0) + applied_messages.each do |applied_message| + applied_message.update_attributes(:viewed => true) + end + # end @issue_custom_fields = IssueCustomField.sorted.all @issue_category ||= IssueCategory.new @member ||= @project.members.new diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c738ab89a..5680a333e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -146,7 +146,7 @@ class UsersController < ApplicationController @message_alls << message_all.message end end - when 'invite_info' + when 'apply' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?" , "AppliedProject", @user).order("created_at desc") when 'homework' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc") diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index e3f8c04d0..a37ce30ff 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -5,6 +5,7 @@