diff --git a/app/Service/v3/Implementations/LocationService.php b/app/Service/v3/Implementations/LocationService.php index 0151b69..8db6f55 100644 --- a/app/Service/v3/Implementations/LocationService.php +++ b/app/Service/v3/Implementations/LocationService.php @@ -84,8 +84,9 @@ class LocationService implements LocationServiceInterface } } - $res = collect($res->toArray())->sortBy(function ($res, $key) { - return $res['distance_num']; + $res = collect($res->toArray())->map(function ($res, $key) { + $markets = collect($res)->sortBy('distance_num'); + return $markets; }); return $res;