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