|
|
@ -1664,7 +1664,8 @@ end
|
|
|
|
# 删除单位
|
|
|
|
# 删除单位
|
|
|
|
def delete_school
|
|
|
|
def delete_school
|
|
|
|
school = School.where(:id => params[:school]).first
|
|
|
|
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
|
|
|
|
ApplyAddSchools.where(:school_id => params[:school]).destroy_all
|
|
|
|
ApplyAddDepartment.where(:school_id => params[:school]).destroy_all
|
|
|
|
ApplyAddDepartment.where(:school_id => params[:school]).destroy_all
|
|
|
|
school.destroy
|
|
|
|
school.destroy
|
|
|
|