From 296f76508aef5f8d8de79ef5ee52f49559670162 Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Fri, 18 Sep 2020 15:35:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=82=E5=9C=BA=E8=B7=9D=E7=A6=BB=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/v3/Implementations/LocationService.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/Service/v3/Implementations/LocationService.php b/app/Service/v3/Implementations/LocationService.php index 8db6f55..561536f 100644 --- a/app/Service/v3/Implementations/LocationService.php +++ b/app/Service/v3/Implementations/LocationService.php @@ -83,13 +83,8 @@ class LocationService implements LocationServiceInterface $m->distance = ''; } } - - $res = collect($res->toArray())->map(function ($res, $key) { - $markets = collect($res)->sortBy('distance_num'); - return $markets; - }); - - return $res; + $res = collect($res)->sortBy('distance_num'); + return $res->values()->all(); } public function getNearestMarket($lng,$lat)