Optimizaciones
This commit is contained in:
@ -46,16 +46,15 @@ class PropiedadUnidad
|
||||
return $this->process($this->propiedadUnidadRepository->edit($propiedadUnidad, $data));
|
||||
}
|
||||
|
||||
protected function process($unidad): Model\Venta\PropiedadUnidad
|
||||
protected function process(Model\Venta\PropiedadUnidad $unidad): Model\Venta\PropiedadUnidad
|
||||
{
|
||||
try {
|
||||
$unidad->precios = $this->precioService->getByUnidad($unidad->id);
|
||||
$unidad->currentPrecio = $this->precioService->getVigenteByUnidad($unidad->id);
|
||||
if ($unidad->valor === 0) {
|
||||
if ($unidad->valor === 0 or $unidad->valor === null) {
|
||||
$unidad->valor = $unidad->currentPrecio->valor;
|
||||
}
|
||||
} catch (EmptyResult) {
|
||||
}
|
||||
} catch (EmptyResult) {}
|
||||
return $unidad;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user