删除学校后,需要重新完善资料

dev_aliyun
daiao 5 years ago
parent 08575044f5
commit 8227a14960

@ -1664,7 +1664,8 @@ 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, profile_completed: false)
UserExtensions.where(:school_id => params[:school]).update_all(school_id: nil, department_id: nil)
User.joins(:user_extension).where(user_extensions: {school_id: params[:school]}).update_all(profile_completed: false)
ApplyAddSchools.where(:school_id => params[:school]).destroy_all
ApplyAddDepartment.where(:school_id => params[:school]).destroy_all
school.destroy

Loading…
Cancel
Save