diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 6bdd726dd..c2e09fe2b 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -87,7 +87,7 @@ class HomeworkCommonsController < ApplicationController end @task_count = @homework_commons.size - order_str = @homework_type == 4 ? "position DESC" : "IF(ISNULL(homework_commons.publish_time),0,1), homework_commons.publish_time DESC, + order_str = @homework_type == 4 ? "homework_commons.position DESC" : "IF(ISNULL(homework_commons.publish_time),0,1), homework_commons.publish_time DESC, homework_commons.created_at DESC" @homework_commons = @homework_commons.order(order_str).page(page).per(15)