request->input('lng',0); $lat = $this->request->input('lat',0); return $this->success(['market' => $this->locationService->getNearestMarket($lng,$lat)]); } public function getMarketListByLocation() { $lng = $this->request->input('lng',0); $lat = $this->request->input('lat',0); return $this->success($this->locationService->getMarketListByLocation($lng,$lat)); } public function getMarketsInfo() { $ret = []; $ret['service_time']='8:30-20:00'; $ret['markets_info']=$this->locationService->getMarketsInfo(); return $this->success($ret); } public function addrSuggestion() { $validator = $this->validationFactory->make( $this->request->all(), ['keyword' => 'required|nonempty'], ['keyword.*' => '关键字不能为空或undefined等'] ); if ($validator->fails()){ throw new ValidationException($validator); } $keyword = $this->request->input('keyword'); $marketId = $this->request->input('market_id'); $page = $this->request->input('page'); $pageSize = $this->request->input('pagesize'); $res = $this->locationService->placeSuggestion($keyword, $marketId, $page, $pageSize); return $this->success($res); } }