|
@@ 88-90 (lines=3) @@
|
| 85 |
|
|
| 86 |
|
$builder->whereIn($this->geoKeyName(), $locations); |
| 87 |
|
|
| 88 |
|
if ($this->databaseDriver() !== 'sqlite' && ! empty($locations)) { |
| 89 |
|
$builder->orderByRaw(DB::raw(sprintf('FIELD(%s,%s)', $this->geoKeyName(), implode(',', $locations)))); |
| 90 |
|
} |
| 91 |
|
} |
| 92 |
|
|
| 93 |
|
public function scopeGeoSearch($builder, $longitude, $latitude, $radius, $sort = 'ASC') |
|
@@ 99-101 (lines=3) @@
|
| 96 |
|
|
| 97 |
|
$builder->whereIn($this->geoKeyName(), $locations); |
| 98 |
|
|
| 99 |
|
if ($this->databaseDriver() !== 'sqlite' && ! empty($locations)) { |
| 100 |
|
$builder->orderByRaw(DB::raw(sprintf('FIELD(%s,%s)', $this->geoKeyName(), implode(',', $locations)))); |
| 101 |
|
} |
| 102 |
|
} |
| 103 |
|
|
| 104 |
|
public function getGeoUnitAttribute() |