From 79d1e96e36e8d25bcf996da5853989614834b479 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 11 Jul 2019 09:57:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=90=9C=E7=B4=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index b8a5ec53c..56fe8fc35 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -44,7 +44,7 @@ class ShixunsController < ApplicationController ## 搜索关键字 匹配关卡名, 用户名, 实训名 和 空格多搜索 if params[:keyword].present? keyword = params[:keyword].strip - @shixuns = @shixuns.joins(:users, challenges: :challenge_tags). + @shixuns = @shixuns.joins(:user, challenges: :challenge_tags). where("challenge_tags.name like '%#{keyword}%' or challenges.subject like '%#{keyword}%' or concat(lastname, firstname) like '%#{keyword}%'