From b8358e913de84d7e09c6596120cd0ba45373cecc Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 14 Mar 2020 22:00:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/weapps/shixun_search_service.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/services/weapps/shixun_search_service.rb b/app/services/weapps/shixun_search_service.rb index 448bb1992..7e0310542 100644 --- a/app/services/weapps/shixun_search_service.rb +++ b/app/services/weapps/shixun_search_service.rb @@ -34,8 +34,7 @@ class Weapps::ShixunSearchService < ApplicationService unless params[:keyword].blank? keyword = params[:keyword].strip shixuns = shixuns.joins(:user). - where("concat(lastname, firstname) like :keyword or shixuns.name like :keyword", - keyword: "%#{keyword}%", name: "%#{keyword.split(" ").join("%")}%").distinct + where("shixuns.name like :keyword", keyword: "%#{keyword}%").distinct end shixuns.order("#{sort_str} #{order_str}")