dev_haigong
daiao 6 years ago
commit 4fb4e7dbc9

@ -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

@ -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}%")

@ -61,7 +61,7 @@
s_html = s_html+ "<p class='clearfix mt5'>" +
" <span class='fl with70'>" +
" <span>" +
" <input type='checkbox' name='school[id]' value='"+array["school"]["id"]+"' id='school_"+array["school"]["id"]+"' class='magic-checkbox'>" +
" <input type='checkbox' name='school[]' value='"+array["school"]["id"]+"' id='school_"+array["school"]["id"]+"' class='magic-checkbox'>" +
" <label for='school_"+array["school"]["id"]+"'>"+array["school"]["name"]+"</label>" +
" </span>\n" +
" </span>\n" +

@ -59,7 +59,7 @@
s_html = s_html+ "<p class='clearfix mt5'>" +
" <span class='fl with70'>" +
" <span>" +
" <input type='checkbox' name='school[id]' value='"+array["school"]["id"]+"' id='school_"+array["school"]["id"]+"' class='magic-checkbox'>" +
" <input type='checkbox' name='school[]' value='"+array["school"]["id"]+"' id='school_"+array["school"]["id"]+"' class='magic-checkbox'>" +
" <label for='school_"+array["school"]["id"]+"'>"+array["school"]["name"]+"</label>" +
" </span>\n" +
" </span>\n" +

Loading…
Cancel
Save