From bc0c8e51710bca195ee774eb6f83b54eaa2ed954 Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 9 Mar 2019 14:52:49 +0800 Subject: [PATCH] =?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/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 ade104e9..04c70e0f 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -836,10 +836,10 @@ class ManagementsController < ApplicationController if search if "u_name" == keyword - @evaluate_recods = EvaluateRecord.joins("join users u on evaluate_records.user_id = u.id").where("concat(u.lastname, u.firstname) like '%#{@search}%'") + @evaluate_recods = EvaluateRecord.joins("join users u on evaluate_records.user_id = u.id").where("concat(u.lastname, u.firstname) like '%#{search}%'") # @evaluate_recods = EvaluateRecord.where(user_id: User.where("concat(lastname, firstname) like '%#{search}%'").pluck(:id)) else - @evaluate_recods = EvaluateRecord.joins("join user_extensions ue on evaluate_records.user_id = ue.user_id").where("ue.school_id in (select id from schools where name like '%#{@search}%')") + @evaluate_recods = EvaluateRecord.joins("join user_extensions ue on evaluate_records.user_id = ue.user_id").where("ue.school_id in (select id from schools where name like '%#{search}%')") # @evaluate_recods = EvaluateRecord.where(user_id: UserExtensions.where(school_id: School.where("name like '%#{search}%'").pluck(:id)).pluck(:user_id)) end else