|
|
@ -65,11 +65,11 @@ class SubjectsController < ApplicationController
|
|
|
|
@total_count = @subjects.size
|
|
|
|
@total_count = @subjects.size
|
|
|
|
|
|
|
|
|
|
|
|
if reorder != "myshixun_count"
|
|
|
|
if reorder != "myshixun_count"
|
|
|
|
@subjects = @subjects.page(page).per(limit).includes(:shixuns)
|
|
|
|
@subjects = @subjects.page(page).per(limit).includes(:shixuns, :repertoire)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
@subjects = @subjects[offset, limit]
|
|
|
|
@subjects = @subjects[offset, limit]
|
|
|
|
subject_ids = @subjects.pluck(:id)
|
|
|
|
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
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|