第一次更新,完成了初版调整
This commit is contained in:
@@ -32,47 +32,9 @@ class Station extends Controller
|
||||
*/
|
||||
public function list(): Json
|
||||
{
|
||||
$SybOil = new SybOil();
|
||||
$company = CompanyModel::detail('2');
|
||||
$param = $this->request->param();
|
||||
$province = Db::name('area')->where(array(
|
||||
['name', '=', $param['province']],
|
||||
['level', '=', 1],
|
||||
))->find();
|
||||
$city = Db::name('area')->where(array(
|
||||
['name', '=', $param['city']],
|
||||
['pid', '=', $province['code']],
|
||||
['level', '=', 2],
|
||||
))->find();
|
||||
$goods = Db::name('goods')->where(array(
|
||||
['oilCardType', '=', 'zsy_ticket'],
|
||||
['province', '=', $param['province']],
|
||||
['status', '=', 10],
|
||||
))->order('stock_total', 'desc')
|
||||
->find();
|
||||
// 企油通改造:本功能依赖已下线的上游(智慧油客/定聚),现已停用。
|
||||
// 企油通无油站查询能力,返回空列表,避免小程序端报错。
|
||||
$list = [];
|
||||
if($goods) {
|
||||
// 对接平台接口
|
||||
$res = $SybOil->baseGasStationList(['goodsNo' => $goods['goods_no'], 'longitude' => $param['longitude'], 'latitude' => $param['latitude'], 'province' => $province['code'], 'city' => $city['code']], $company);
|
||||
if (isset($res['data']['zsyResp']['count']) && $res['data']['zsyResp']['count'] > 0) {
|
||||
$lists = $res['data']['zsyResp']['lists'];
|
||||
foreach ($lists as $k => $array) {
|
||||
$list[] = [
|
||||
'id' => $k + 1,
|
||||
'name' => $array['name'],
|
||||
'brand' => $array['brand'] == 1 ? '中国石油' : '中国BP',
|
||||
'latitude' => $array['lat'],
|
||||
'longitude' => $array['lng'],
|
||||
'address' => '',
|
||||
'distance' => $array['nearBy'],
|
||||
'width' => 30,
|
||||
'height' => 30,
|
||||
'iconPath' => '/static/marker.png',
|
||||
'stationCode' => $array['stationCode'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->renderSuccess(compact('list'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user