You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<?php
namespace App\Controller\v3;
use App\Controller\BaseController;use App\Service\v3\Interfaces\LocationServiceInterface;use Hyperf\Di\Annotation\Inject;
/** * 定位相关 * Class LocationController * @package App\Controller\v3 */class LocationController extends BaseController{ /** * @Inject * @var LocationServiceInterface */ protected $locationService;
/** * 获取当前用户定位最近的市场 * 1.用户上报经纬度数据 * 2.如果经纬度不存在或无法获取到最近市场信息,则返回空数据 * 3.根据经纬度查询获取市场数据,id、名称、省份、城市、行政区、地址、经纬度 */ public function getNearestMarket() { return $this->success([ 'market' => [ 'id' => 1, 'name' => '海尔青啤', 'province_id' => 1, 'province_name' => '广西', 'city_id' => 2, 'city_name' => '南宁市', 'area_id' => 3, 'area_name' => '良庆区', 'address' => '海尔青啤广场', 'lng' => '108.383566', 'lat' => '22.759946', ] ]); }
public function getMarketListByLocation() { $cityIds = [2163,2189]; return $this->success($this->locationService->getMarketListByLocation($cityIds)); }
public function getMarketsInfo() { $ret = []; $ret['service_time']='8:30-20:00'; $ret['markets_info']=$this->locationService->getMarketsInfo(); return $this->success($ret); }}
|