|
|
|
@ -15,7 +15,7 @@ class Admins::LaboratoryQuery < ApplicationQuery
|
|
|
|
|
keyword = strip_param(:keyword)
|
|
|
|
|
if keyword.present?
|
|
|
|
|
like_sql = 'schools.name LIKE :keyword OR laboratories.identifier LIKE :keyword'
|
|
|
|
|
laboratories = laboratories.joins(:school).where(like_sql, keyword: "%#{keyword}%")
|
|
|
|
|
laboratories = laboratories.left_joins(:school).where(like_sql, keyword: "%#{keyword}%")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
custom_sort laboratories, params[:sort_by], params[:sort_direction]
|
|
|
|
|