From 2514d0cdfd7ea83462411f6587f627d22f22e5c7 Mon Sep 17 00:00:00 2001 From: Miguel Santos Date: Wed, 14 Aug 2019 18:55:39 +0100 Subject: [PATCH] fix(Map): Removed Tfuel exceptions --- app/Http/Controllers/APIController.php | 26 ++------------------------ resources/js/map.js | 10 +++++----- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/app/Http/Controllers/APIController.php b/app/Http/Controllers/APIController.php index 1d0defa..5867475 100644 --- a/app/Http/Controllers/APIController.php +++ b/app/Http/Controllers/APIController.php @@ -60,28 +60,6 @@ public function fetch(Request $request) 'district' => $station->district, ]; } - if ($ext_auth->brand == 'Tfuel') { - $stations = FuelStation::where('id', '=', 972)->orWhere('id', '=', 1549)->get(); - foreach ($stations as $station) { - $output[] = [ - 'id' => $station->id, - 'name' => $station->name, - 'brand' => $station->brand, - 'sell_gasoline' => $station->sell_gasoline, - 'sell_diesel' => $station->sell_diesel, - 'sell_lpg' => $station->sell_lpg, - 'has_gasoline' => $station->has_gasoline, - 'has_diesel' => $station->has_diesel, - 'has_lpg' => $station->has_lpg, - 'lat' => $station->long, - 'long' => $station->lat, - 'repa' => $station->repa, - 'county' => $station->county, - 'district' => $station->district, - ]; - } - } - return response()->json($output); } } @@ -98,7 +76,7 @@ public function push(Request $request) $fuel_station = FuelStation::where('id', '=', $request->input('id')); if ($fuel_station->count() > 0) { $fuel_station = $fuel_station->first(); - if (($fuel_station->brand == $ext_auth->brand) || ($fuel_station->brand_management == $ext_auth->brand) || ($ext_auth->brand == 'WRITEREAD') || ($fuel_station->id == 972 && $ext_auth->brand == 'Tfuel') || ($fuel_station->id == 1549 && $ext_auth->brand == 'Tfuel')) { + if (($fuel_station->brand == $ext_auth->brand) || ($fuel_station->brand_management == $ext_auth->brand) || ($ext_auth->brand == 'WRITEREAD')) { $has_gasoline = \intval($request->input('has_gasoline')); $has_diesel = \intval($request->input('has_diesel')); $has_lpg = \intval($request->input('has_lpg')); @@ -217,7 +195,7 @@ public function change(Request $request) $fuel_station = FuelStation::where('id', '=', $request->input('id')); if ($fuel_station->count() > 0) { $fuel_station = $fuel_station->first(); - if (($fuel_station->brand == $ext_auth->brand) || ($fuel_station->brand_management == $ext_auth->brand) || ($ext_auth->brand == 'WRITEREAD') || ($fuel_station->id == 972 && $ext_auth->brand == 'Tfuel') || ($fuel_station->id == 1549 && $ext_auth->brand == 'Tfuel')) { + if (($fuel_station->brand == $ext_auth->brand) || ($fuel_station->brand_management == $ext_auth->brand) || ($ext_auth->brand == 'WRITEREAD')) { $brand = $request->input('brand'); $management_brand = ''; if ($brand != $ext_auth->brand && $ext_auth->brand != 'WRITEREAD') { diff --git a/resources/js/map.js b/resources/js/map.js index 19414b2..514e905 100644 --- a/resources/js/map.js +++ b/resources/js/map.js @@ -332,26 +332,26 @@ function addLayersFunctionality(layerID) { fuelIcons + '' + ''; - if (e.features[0].properties.brand == "Prio") { + if (e.features[0].properties.brand == "Prio" || e.features[0].properties.brand_management == "Prio") { description += '
AS DISPONIBILIDADES DAS BOMBAS DA PRIO
' + '
LISTADAS NESTE SITE ESTÃO A SER GERIDAS
' + '
'; } - else if (e.features[0].properties.brand == "OZ Energia") { + else if (e.features[0].properties.brand == "OZ Energia" || e.features[0].properties.brand_management == "OZ Energia") { description += '
AS DISPONIBILIDADES DAS BOMBAS DA OZ ENERGIA
' + '
LISTADAS NESTE SITE ESTÃO A SER GERIDAS
' + '
'; } - else if (e.features[0].properties.brand == "Ecobrent") { + else if (e.features[0].properties.brand == "Ecobrent" || e.features[0].properties.brand_management == "Ecobrent") { description += '
AS DISPONIBILIDADES DAS BOMBAS DA ECOBRENT
' + '
LISTADAS NESTE SITE ESTÃO A SER GERIDAS
' + '
'; - } else if (e.features[0].properties.brand == "Bxpress") { + } else if (e.features[0].properties.brand == "Bxpress" || e.features[0].properties.brand_management == "Bxpress") { description += '
AS DISPONIBILIDADES DAS BOMBAS DA BXPRESS
' + '
LISTADAS NESTE SITE ESTÃO A SER GERIDAS
' + '
'; } - else if (e.features[0].properties.brand == "TFuel" || e.features[0].properties.id == 972 || e.features[0].properties.id == 1549) { + else if (e.features[0].properties.brand == "Tfuel" || e.features[0].properties.brand_management == "Tfuel") { description += '
AS DISPONIBILIDADES DAS BOMBAS DA TFUEL
' + '
LISTADAS NESTE SITE ESTÃO A SER GERIDAS
' + '
';