@@ -178,23 +178,16 @@ private function buildSearchParams(Builder $builder, int $page, int $perPage): a
178178 * @param string $column
179179 * @param float $lat
180180 * @param float $lng
181- * @param string $radius
182181 * @param string $direction
183- * @param bool $exclude_radius
184182 *
185183 * @return string
186184 * @noinspection PhpPureAttributeCanBeAddedInspection
187185 */
188- private function parseOrderByLocation (string $ column , float $ lat , float $ lng , string $ radius , string $ direction = 'asc ' , bool $ exclude_radius = false ): string
186+ private function parseOrderByLocation (string $ column , float $ lat , float $ lng , string $ direction = 'asc ' ): string
189187 {
190188 $ direction = Str::lower ($ direction ) === 'asc ' ? 'asc ' : 'desc ' ;
191- $ str = $ column .'( ' .$ lat .', ' .$ lng .', ' ;
192- if ($ exclude_radius ) {
193- $ str .= 'exclude_radius: ' .$ radius ;
194- } else {
195- $ str .= $ radius ;
196- }
197- return $ str .'): ' .$ direction ;
189+ $ str = $ column .'( ' .$ lat .', ' .$ lng .') ' ;
190+ return $ str .': ' .$ direction ;
198191 }
199192
200193 /**
@@ -446,14 +439,23 @@ public function limitHits(int $limitHits): static
446439 return $ this ;
447440 }
448441
449- public function orderByLocation (string $ column , float $ lat , float $ lng , string $ radius , bool $ excludeRadius ): static
442+ /**
443+ * Add location to order by clause
444+ *
445+ * @param string $column
446+ * @param float $lat
447+ * @param float $lng
448+ * @param string $direction
449+ *
450+ * @return $this
451+ */
452+ public function orderByLocation (string $ column , float $ lat , float $ lng , string $ direction ): static
450453 {
451454 $ this ->locationOrderBy = [
452- 'column ' => $ column ,
453- 'lat ' => $ lat ,
454- 'lng ' => $ lng ,
455- 'radius ' => $ radius ,
456- 'exclude_radius ' => $ excludeRadius ,
455+ 'column ' => $ column ,
456+ 'lat ' => $ lat ,
457+ 'lng ' => $ lng ,
458+ 'direction ' => $ direction ,
457459 ];
458460 return $ this ;
459461 }
0 commit comments