:
lng, lat, dis = params[:lng], params[:lat], params[:dis] page, per_page = params[:page] || 1 , params[:per_page] || 30 sms = SideMongo.geo_near([lng.to_f,lat.to_f], max_distance: dis.to_i, unit: "km".to_sym, spherical: true).sort_by!{|r| r.geo[:distance] } page_sms = sms.per(per_page).page(page)
source share