|
|
|
@ -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}")
|
|
|
|
|