|
|
@ -17,11 +17,6 @@ class Admins::SchoolQuery < ApplicationQuery
|
|
|
|
if keyword
|
|
|
|
if keyword
|
|
|
|
schools = schools.where('schools.name LIKE ?', "%#{keyword}%")
|
|
|
|
schools = schools.where('schools.name LIKE ?', "%#{keyword}%")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Rails.logger.info("#########school_name: ##{schools.first.name}")
|
|
|
|
|
|
|
|
Rails.logger.info("#########school_id: ##{schools.first.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]
|
|
|
|
custom_sort schools, params[:sort_by], params[:sort_direction]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|