From 6d535cd4bc057298e1b94b0d05dc9ebb258df5b7 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 16 Jul 2019 10:02:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=B7=BB=E5=8A=A0=E5=90=88?= =?UTF-8?q?=E4=BD=9C=E8=80=85=E7=9A=84=E6=89=8B=E6=9C=BA=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 8f6dd23a4..599be4cde 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -662,8 +662,8 @@ class ShixunsController < ApplicationController school_name = "%#{params[:school_name].to_s.strip}%" if user_name.present? || school_name.present? @users = User.joins(user_extension: :school).where("users.id not in #{member_ids} AND users.status = 1 AND - LOWER(users.lastname) LIKE '#{user_name}' AND LOWER(schools.name) LIKE - '#{school_name}'") + (LOWER(users.lastname) LIKE ? or users.phone like ?) AND LOWER(schools.name) LIKE + ?", user_name, user_name, school_name) else @users = User.none end