chromesetting
daiao 5 years ago
parent 72b17b2f43
commit e7a23b2b13

@ -19,7 +19,7 @@ class Admins::SchoolQuery < ApplicationQuery
end
Rails.logger.info("#########school_name: ##{schools.first.name}")
Rails.logger.info("#########school_id: ##{schools.first.id}")
schools = schools.joins(:user_extensions).group("schools.id")
schools = schools.joins("right join user_extensions on user_extensions.school_id = schools.id").group("schools.id")
Rails.logger.info("#########school_id: ##{schools.first.id}")
schools = schools.select('schools.*, COUNT(*) AS users_count')
custom_sort schools, params[:sort_by], params[:sort_direction]

Loading…
Cancel
Save