|
|
|
@ -35,11 +35,10 @@ class Weapps::ShixunSearchService < ApplicationService
|
|
|
|
|
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.
|
|
|
|
|
order("#{sort_str} #{order_str}")
|
|
|
|
|
keyword: "%#{keyword}%", name: "%#{keyword.split(" ").join("%")}%").distinct
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
shixuns
|
|
|
|
|
shixuns.order("#{sort_str} #{order_str}")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|