添加客户的过滤

dev_local
cxt 6 years ago
parent 18de726bff
commit 9f39908587

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

Loading…
Cancel
Save