diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 8e4b888a1..052db3e4f 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -949,7 +949,7 @@ class HomeworkCommonsController < ApplicationController # 最热排序 if reorder == "myshixun_count" - if select + if select && select != "all" @subjects = Subject.find_by_sql("SELECT subjects.id, subjects.user_id, subjects.name, subjects.stages_count, subjects.repertoire_id, subjects.status, subjects.shixuns_count, sum(shixuns.myshixuns_count) AS myshixun_member_count FROM subjects join stage_shixuns on stage_shixuns.subject_id = subjects.id join shixuns on shixuns.id = stage_shixuns.shixun_id where @@ -973,7 +973,7 @@ class HomeworkCommonsController < ApplicationController end # 类型 - if select + if select && select != "all" @subjects = @subjects.where(repertoire_id: select) end