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