diff --git a/app/common/repositories/user/ExchangePickupPointRepository.php b/app/common/repositories/user/ExchangePickupPointRepository.php index 454817c..02dfb71 100644 --- a/app/common/repositories/user/ExchangePickupPointRepository.php +++ b/app/common/repositories/user/ExchangePickupPointRepository.php @@ -49,6 +49,9 @@ class ExchangePickupPointRepository extends BaseRepository{ ->when(isset($params['is_show']) && $params['is_show'] !== '',function($query) use ($params){ $query->where('is_show',$params['is_show']); }) + ->when(isset($params['default_point_id']) && $params['default_point_id'] > 0,function($query) use ($params){ + $query->where('id',$params['default_point_id']); + }) ->when(!empty($params['address']),function($query) use ($params){ $query->where('address', "like", "%{$params['address']}%") ->whereOr('title','like',"%{$params['address']}%"); diff --git a/app/controller/api/user/Exchange.php b/app/controller/api/user/Exchange.php index 4bdeeea..cb93371 100644 --- a/app/controller/api/user/Exchange.php +++ b/app/controller/api/user/Exchange.php @@ -55,12 +55,11 @@ class Exchange extends BaseController{ * @return mixed */ public function getPointList(){ - $search = $this->request->params(['uid','address']); + $search = $this->request->params(['uid', 'address', 'default_point_id']); $search['is_show'] = 1; $data = app()->make(ExchangePickupPointRepository::class)->getList($search, 1, 30); $list = $data['list']; - return app('json')->success($list); } /**