|
|
|
@ -1756,8 +1756,10 @@ end
|
|
|
|
|
Tiding.where(:user_id => 1, :trigger_user_id => applied_department.user_id, :container_id => applied_department.id, :container_type => 'ApplyAddDepartment', :status => 0, :tiding_type => "Apply").update_all(:status => 1)
|
|
|
|
|
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, profile_completed: false)
|
|
|
|
|
user_exs = UserExtensions.where("department_id = #{applied_department.department_id}")
|
|
|
|
|
users = User.where(id: user_exs.pluck(:user_id))
|
|
|
|
|
user_exs.update_all(department_id: nil)
|
|
|
|
|
users.update_all(profile_completed: false)
|
|
|
|
|
applied_department.department.destroy
|
|
|
|
|
# 已审批删除
|
|
|
|
|
elsif params[:tip] == "applied"
|
|
|
|
|