Simplificacion de retorno de ventas por unidades

This commit is contained in:
Juan Pablo Vial
2025-04-22 13:08:15 -04:00
parent 5147450ed6
commit eabdab23c3
3 changed files with 48 additions and 4 deletions

View File

@ -321,7 +321,7 @@ class Venta extends Ideal\Repository
* @return array
* @throws Implement\Exception\EmptyResult
*/
public function fetchActiveByUnidadIds(array $unidad_ids): array
public function fetchActiveArrayByUnidadIds(array $unidad_ids): array
{
$subSubQuery = $this->connection->getQueryBuilder()
->select('MAX(`id`) AS `id`, `venta`')
@ -347,7 +347,7 @@ class Venta extends Ideal\Repository
return array_map(function($result) {
return [
'unidad_id' => $result['unidad'],
'venta' => $this->load($result)
'venta' => $result
];
}, $results);
} catch (PDOException $exception) {