From 4b88683b8426eb194ecd90ec09a66c91ac4d2034 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 25 Jul 2019 10:32:22 +0800 Subject: [PATCH] set profile completed false when delete school apply && fix agree identity auth --- app/controllers/managements_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 98b58614..623268d2 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -1661,7 +1661,7 @@ end # 删除单位 def delete_school school = School.where(:id => params[:school]).first - UserExtensions.where(:school_id => params[:school]).update_all(:school_id => nil, :department_id => nil) + UserExtensions.where(:school_id => params[:school]).update_all(school_id: nil, department_id: nil, profile_completed: false) ApplyAddSchools.where(:school_id => params[:school]).destroy_all ApplyAddDepartment.where(:school_id => params[:school]).destroy_all school.destroy @@ -1752,7 +1752,7 @@ end Tiding.create(:user_id => applied_department.user_id, :trigger_user_id => 0, :container_id => applied_department.id, :container_type =>'ApplyAddDepartment', :belong_container_id => applied_department.department.school_id, :belong_container_type=> 'School', :tiding_type => "System", :status => 2, :extra => params[:reason]) # 删除学校的用户 users = UserExtensions.where("department_id = #{applied_department.department_id}") - users.update_all(:department_id => nil) + users.update_all(department_id: nil, profile_completed: false) applied_department.department.destroy # 已审批删除 elsif params[:tip] == "applied" @@ -3692,7 +3692,7 @@ end diskfile1 = disk_filename("UserAuthentication", apply_user.user_id) +"ID" apply_user.update_attributes(:is_delete => true) - File.delete(diskfile1) + File.delete(diskfile1) if File.exist?(diskfile1) =begin begin