diff --git a/app/common/service/PostService.php b/app/common/service/PostService.php index f103854..02a006c 100644 --- a/app/common/service/PostService.php +++ b/app/common/service/PostService.php @@ -214,6 +214,7 @@ class PostService { $lng = $request->get('lng'); $lat = $request->get('lat'); + $status = $request->get('status', 1); if (!$lng || !$lat) { throw new BusinessException('经纬度必传'); @@ -242,6 +243,7 @@ class PostService SIN(RADIANS(?)) * SIN(RADIANS(latitude)) )) AS distance FROM post + WHERE $status HAVING distance <= ? ORDER BY distance LIMIT 50";