From d52fec1f51b811f1f4399e08e862cfc8363cb27a Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 13 Mar 2019 14:39:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E7=9A=84=E8=AF=BE=E5=A0=82=E5=88=97=E8=A1=A8=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=97=B6=E4=BC=9A=E6=9C=89=E9=83=A8=E5=88=86=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1?= 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 04c70e0f..9992d000 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -1796,7 +1796,7 @@ end @school_id = params[:school_id] if params[:school_id] && params[:school_id] != '' - @courses = Course.joins("join users u on courses.tea_id = u.id").joins("join user_extensions ue on u.id = ue.user_id").where("ue.school_id = #{params[:school_id]}") + @courses = @courses.joins("join user_extensions ue on courses.tea_id = ue.user_id").where("ue.school_id = #{params[:school_id]}") end if params[:homepage_show] @@ -1819,7 +1819,7 @@ end user_id = User.where("concat(lastname, firstname) like '%#{@search}%'") @courses = @courses.joins("join users u on courses.tea_id = u.id").where("concat(u.lastname, u.firstname) like '%#{@search}%'") end - else + elsif "dep_name" == @keyword school = School.where("name like '%#{@search}%'").map(&:id) @courses = @courses.where(:school_id => school) # @courses= @courses.where("name like '%#{@search}%'")