Browse Source

添加获取市场信息接口

master
Mike 5 years ago
parent
commit
e3269131e6
  1. 9
      app/Controller/v3/LocationController.php
  2. 6
      app/Service/v3/Implementations/LocationService.php
  3. 1
      app/Service/v3/Interfaces/LocationServiceInterface.php
  4. 1
      config/routes.php

9
app/Controller/v3/LocationController.php

@ -49,4 +49,13 @@ class LocationController extends BaseController
$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 $ret;
}
}

6
app/Service/v3/Implementations/LocationService.php

@ -72,4 +72,10 @@ class LocationService implements LocationServiceInterface
return round($distance, $decimal);
}
//获取服务站信息
function getMarketsInfo()
{
return Market::where('status',1)->get();
}
}

1
app/Service/v3/Interfaces/LocationServiceInterface.php

@ -11,4 +11,5 @@ interface LocationServiceInterface
public function undo();
public function getMarketListByLocation($cityIds);
public function searchMarket($key,$cityId = 2163);
public function getMarketsInfo();
}

1
config/routes.php

@ -91,6 +91,7 @@ Router::addGroup('/v3/', function () {
Router::post('goodsRecommend/getByTab', 'App\Controller\v3\GoodsRecommendController@getByTab');
Router::post('store/index', 'App\Controller\v3\StoreController@index');
Router::post('Search/market', 'App\Controller\v3\SearchController@market');
Router::post('market/services', 'App\Controller\v3\LocationController@getMarketsInfo');
},['middleware' => [\App\Middleware\Auth\ApiMiddleware::class]]);
// 需要登录的路由

Loading…
Cancel
Save