选用实训的排序

dev_video
cxt 5 years ago
parent 7ed5005305
commit 81ceac90e7

@ -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

Loading…
Cancel
Save