Precios con promociones para listado brokers

This commit is contained in:
Juan Pablo Vial
2025-04-03 17:22:38 -03:00
parent 7b2df74e4d
commit 7a97fc9dfe
5 changed files with 93 additions and 44 deletions

View File

@ -63,21 +63,19 @@ class Unidades extends Ideal\Controller
try {
$proyecto = $proyectoService->getById($proyecto_id);
foreach ($unidad_ids as $unidad_id) {
$output['estados'][] = [
'id' => $unidad_id,
'sold' => false
];
try {
$unidad = $unidadRepository->fetchById($unidad_id);
} catch (Implement\Exception\EmptyResult) {
try {
$output['estados'][] = [
'id' => $unidad_id,
'sold' => $unidadRepository->fetchSoldByUnidad((int) $unidad_id)
'sold' => $unidadRepository->fetchSoldByUnidad($unidad->id)
];
} catch (Implement\Exception\EmptyResult) {
$output['estados'][] = [
'id' => $unidad_id,
'sold' => false
];
}
}
} catch (Implement\Exception\EmptyResult) {}
} catch (Implement\Exception\EmptyResult) {}
}
} catch (Implement\Exception\EmptyResult) {}
return $this->withJson($response, $output);