From 320b347c5eb32b735bdf7d13e84ca6283e188b5f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 1 Aug 2019 11:06:39 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E6=A0=A1=E6=97=A0=E6=B3=95=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 8d1fc719b..fca143623 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -408,18 +408,16 @@ class ShixunsController < ApplicationController @shixun.update_attributes(shixun_params) @shixun.shixun_info.update_attributes(shixun_info_params) @shixun.shixun_schools.delete_all - if params[:scope_partment].present? && params[:shixun][:user_scope].to_i == 1 + logger.info("##########scope_partment:###{params[:scope_partment]}") + # scope_partment: 高校的名称 + if params[:scope_partment].present? arr = [] ids = School.where(:name => params[:scope_partment]).pluck(:id).uniq ids.each do |id| arr << { :school_id => id, :shixun_id => @shixun.id } end ShixunSchool.create!(arr) - use_scope = 1 - else - use_scope = 0 end - @shixun.update_attributes!(:use_scope => use_scope) # 超级管理员和运营人员才能保存 中间层服务器pod信息的配置 if current_user.admin? || current_user.business? @shixun.shixun_service_configs.destroy_all