Created
July 19, 2017 16:17
-
-
Save Prav92/c97665548bfea89c2a45186e7f5a6d0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.search_007(query, lat, lon, offset, limit, options={}) | |
if options.values.compact.any? | |
return search_007b(query, lat, lon, offset, limit, options) | |
end | |
if lat.nil? || lon.nil? | |
return search_007x(query, offset, limit) | |
end | |
Doctor.where("doctors.full_name LIKE ?", "%#{query}%") | |
.order("doctors.overall_rating DESC") | |
.calculate_distance2a(lat, lon) | |
.where("healthcare_centers.type_id != 4") | |
.having("distance <= 25") | |
.order("doctors.full_name") | |
.offset(offset) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment