Entrega dashboard e correccoes transversais preservando Ofertas instalado
tests / ci (push) Canceled after 0s
tests / ci (push) Canceled after 0s
This commit is contained in:
@@ -66,11 +66,16 @@ final class InvestmentCorridorContext
|
||||
*/
|
||||
public function parks(?string $key, ?string $territory): array
|
||||
{
|
||||
if (! $key || ! $territory) {
|
||||
if (! $territory) {
|
||||
return [];
|
||||
}
|
||||
abort_unless($this->compatible($key, $territory), 422, 'A localização não pertence ao corredor escolhido.');
|
||||
if ($key) {
|
||||
abort_unless($this->compatible($key, $territory), 422, 'A localização não pertence ao corredor escolhido.');
|
||||
}
|
||||
$selectedPath = array_column(app(InvestmentGeography::class)->path($territory), 'id');
|
||||
if ($selectedPath === []) {
|
||||
return [];
|
||||
}
|
||||
$candidates = app(InvestmentZones::class)->visible()->whereIn('category', ['industrial_park', 'zee', 'zfi'])->orderBy('name')->get();
|
||||
$result = [];
|
||||
foreach ($candidates as $zone) {
|
||||
@@ -83,7 +88,7 @@ final class InvestmentCorridorContext
|
||||
}
|
||||
foreach ($ids as $link) {
|
||||
$id = $link->geo_location_id;
|
||||
if (! $this->compatible($key, $id)) {
|
||||
if ($key && ! $this->compatible($key, $id)) {
|
||||
continue;
|
||||
}
|
||||
$path = array_column(app(InvestmentGeography::class)->path($id), 'id');
|
||||
|
||||
Reference in New Issue
Block a user