diff --git a/app/controllers/shixun_lists_controller.rb b/app/controllers/shixun_lists_controller.rb index 268548df9..ece1d0be5 100644 --- a/app/controllers/shixun_lists_controller.rb +++ b/app/controllers/shixun_lists_controller.rb @@ -1,7 +1,7 @@ class ShixunListsController < ApplicationController def index @results = ShixunSearchService.call(search_params, current_laboratory) - Rails.logger.info("########results: #{@results}") + Rails.logger.info("########results: #{@results.includes(:subjects)}") end private diff --git a/app/views/shixun_lists/index.json.jbuilder b/app/views/shixun_lists/index.json.jbuilder index 9526b0173..094c2160b 100644 --- a/app/views/shixun_lists/index.json.jbuilder +++ b/app/views/shixun_lists/index.json.jbuilder @@ -21,8 +21,10 @@ json.shixun_list do json.pic url_to_avatar(obj) json.content highlights json.level level_to_s(obj.trainee) - json.subjects obj.subjects.visible.unhidden.uniq do |subject| - json.(subject, :id, :name) + if params[:sort] != "wechat_myshixuns_count" + json.subjects obj.subjects.visible.unhidden.uniq do |subject| + json.(subject, :id, :name) + end end end end \ No newline at end of file