From 72a7a1e9f2a177c97c5c32a8e874743165f1568f Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Thu, 11 Aug 2016 11:13:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E6=98=AF=E9=A1=B9=E7=9B=AE=E6=88=90?= =?UTF-8?q?=E5=91=98=E5=88=99=E4=B9=8B=E5=89=8D=E7=9A=84=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E9=83=BD=E6=94=B9=E4=B8=BA=E6=8B=92=E7=BB=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/projects_service.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/services/projects_service.rb b/app/services/projects_service.rb index 2b72fed69..4980cd03a 100644 --- a/app/services/projects_service.rb +++ b/app/services/projects_service.rb @@ -149,6 +149,10 @@ class ProjectsService if current_user.member_of?(project) #如果已经是成员 member = project.member_principals.includes(:roles, :principal).where("user_id=?",current_user.id).first status = member.member_roles[0].role_id + + #将之前的申请都改为已拒绝 + applied_messages = AppliedMessage.where(:project_id => project.id, :status => 1, :applied_user_id=>current_user.id,:applied_type => "AppliedProject") + applied_messages.update_all(:status=>5) else if params[:invite_code].present?