diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index eafc1c62..2505a3bf 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -257,7 +257,7 @@ class CollegesController < ApplicationController unless (User.current.admin? || DepartmentMember.where(:user_id => User.current.id, :department_id => @department.id).first.present? || (User.current.user_extensions.try(:school_id) == @department.school_id && User.current.user_extensions.try(:identity) == 0) || - @department.school.try(:partner_id) == User.current.partner_id) + (@department.school.try(:customer_id) && User.current.try(:partner).try(:customer_ids) && User.current.try(:partner).try(:customer_ids).include?(@department.school.try(:customer_id)))) render_403 end end diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 3d126f3b..7168473b 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -1216,9 +1216,9 @@ end @partner = Partner.find partner_id @customers = @partner.customers if @customers.present? - @schools = School.where("(partner_id != ? or partner_id is NULL) and (customer_id is NULL or customer_id not in(#{@customers.map(&:id).join(",")}))", @partner.id) + @schools = School.where("(partner_id != ? or partner_id is NULL) and customer_id is NULL", @partner.id) else - @schools = School.where("partner_id != ? or partner_id is NULL", @partner.id) + @schools = School.where("customer_id is null and (partner_id != ? or partner_id is NULL)", @partner.id) end if params[:search] @schools = @schools.where("name like ?", "%#{@search}%") diff --git a/app/views/managements/_customer_addUnit.html.erb b/app/views/managements/_customer_addUnit.html.erb index b049d751..786c4cac 100644 --- a/app/views/managements/_customer_addUnit.html.erb +++ b/app/views/managements/_customer_addUnit.html.erb @@ -61,7 +61,7 @@ s_html = s_html+ "

" + " " + " " + - " " + + " " + " " + " \n" + " \n" + diff --git a/app/views/managements/_partner_addUnit.html.erb b/app/views/managements/_partner_addUnit.html.erb index bd993a76..421b3ddb 100644 --- a/app/views/managements/_partner_addUnit.html.erb +++ b/app/views/managements/_partner_addUnit.html.erb @@ -59,7 +59,7 @@ s_html = s_html+ "

" + " " + " " + - " " + + " " + " " + " \n" + " \n" +