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