From 327c856463018797ce1beb48e87558dd5109d282 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 14 Mar 2020 22:33:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/weapps/shixun_search_service.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/services/weapps/shixun_search_service.rb b/app/services/weapps/shixun_search_service.rb index 448bb1992..e44943b1e 100644 --- a/app/services/weapps/shixun_search_service.rb +++ b/app/services/weapps/shixun_search_service.rb @@ -38,7 +38,14 @@ class Weapps::ShixunSearchService < ApplicationService keyword: "%#{keyword}%", name: "%#{keyword.split(" ").join("%")}%").distinct end - shixuns.order("#{sort_str} #{order_str}") + order = + if sort_str == "wechat_myshixuns_count" + "is_wechat_support desc, myshixuns_count #{order_str}" + else + "#{sort_str} #{order_str}" + end + + shixuns.order(order) end private From c83bf14b872e82bb1b2b6eb68ca896850fe9dd70 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 14 Mar 2020 22:37:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/weapps/shixun_lists/index.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/weapps/shixun_lists/index.json.jbuilder b/app/views/weapps/shixun_lists/index.json.jbuilder index fac238f45..10b66fdfa 100644 --- a/app/views/weapps/shixun_lists/index.json.jbuilder +++ b/app/views/weapps/shixun_lists/index.json.jbuilder @@ -5,5 +5,6 @@ json.shixun_list @results do |obj| json.study_count obj.myshixuns_count json.author_name obj.user.real_name json.author_img url_to_avatar(obj.user) + json.pic url_to_avatar(obj) end json.shixuns_count @total_count \ No newline at end of file