|
|
|
@ -992,13 +992,15 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
@total_count = @subjects.size
|
|
|
|
|
|
|
|
|
|
if reorder != "myshixun_count"
|
|
|
|
|
@subjects = @subjects.page(page).per(limit).includes(:shixuns, user: [user_extension: :school])
|
|
|
|
|
# @subjects = @subjects.page(page).per(limit).includes(:shixuns, user: [user_extension: :school])
|
|
|
|
|
@subjects = @subjects.page(page).per(limit).includes(:shixuns)
|
|
|
|
|
else
|
|
|
|
|
@subjects = @subjects[offset, limit]
|
|
|
|
|
unless @subjects.blank?
|
|
|
|
|
subject_ids = @subjects.pluck(:id)
|
|
|
|
|
order_ids = subject_ids.size > 0 ? subject_ids.join(',') : -1
|
|
|
|
|
@subjects = Subject.where(id: subject_ids).order("field(id,#{order_ids})").includes(:shixuns, user: [user_extension: :school])
|
|
|
|
|
# @subjects = Subject.where(id: subject_ids).order("field(id,#{order_ids})").includes(:shixuns, user: [user_extension: :school])
|
|
|
|
|
@subjects = Subject.where(id: subject_ids).order("field(id,#{order_ids})").includes(:shixuns)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|