From 18de726bff44c0a43d35e1bb2796fc2c5f182405 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 4 Apr 2019 18:17:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/colleges_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 9f399085870e420877f1e030944d6e8641507f6c Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 4 Apr 2019 18:28:16 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 13f408c2..822c5fdf 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}%") From 94e3289746ea9f21e2ad4df25b1214b29069aa90 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 4 Apr 2019 18:38:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/managements/_customer_addUnit.html.erb | 2 +- app/views/managements/_partner_addUnit.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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" +