set profile completed false when delete school apply && fix agree identity auth

dev_aliyun
p31729568 5 years ago
parent 3227be8a7c
commit 4b88683b84

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

Loading…
Cancel
Save