|
|
|
@ -65,11 +65,11 @@ class SubjectsController < ApplicationController
|
|
|
|
|
@total_count = @subjects.size
|
|
|
|
|
|
|
|
|
|
if reorder != "myshixun_count"
|
|
|
|
|
@subjects = @subjects.page(page).per(limit).includes(:shixuns)
|
|
|
|
|
@subjects = @subjects.page(page).per(limit).includes(:shixuns, :repertoire)
|
|
|
|
|
else
|
|
|
|
|
@subjects = @subjects[offset, limit]
|
|
|
|
|
subject_ids = @subjects.pluck(:id)
|
|
|
|
|
@subjects = Subject.where(id: subject_ids).order("field(id,#{subject_ids.join(',')})").includes(:shixuns)
|
|
|
|
|
@subjects = Subject.where(id: subject_ids).order("field(id,#{subject_ids.join(',')})").includes(:shixuns, :repertoire)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|