|
|
|
@ -19,9 +19,9 @@ class Weapps::SubjectQuery < ApplicationQuery
|
|
|
|
|
subjects = subjects.joins(:sub_discipline_containers).where(sub_discipline_containers: {container_type: "Subject"})
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
subjects = subjects.left_joins(:shixuns).select('subjects.id, subjects.name, subjects.excellent, subjects.stages_count, subjects.status,
|
|
|
|
|
subjects = subjects.left_joins(:shixuns).select('subjects.id, subjects.name, subjects.excellent, subjects.stages_count, subjects.status, subjects.homepage_show,
|
|
|
|
|
subjects.shixuns_count, subjects.updated_at, IFNULL(sum(shixuns.myshixuns_count), 0) myshixuns_count')
|
|
|
|
|
.group('subjects.id').order("#{order_type} #{sort_type}")
|
|
|
|
|
.group('subjects.id').order("(homepage_show, #{order_type}) #{sort_type}")
|
|
|
|
|
subjects
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|