FIX: Mostrar unidad principal en busqueda

This commit is contained in:
Juan Pablo Vial
2024-07-03 17:20:26 -04:00
parent d68eba5697
commit 0d5c9efd68
2 changed files with 4 additions and 5 deletions

View File

@ -107,10 +107,6 @@ class Search
} catch (Exception\EmptyRedis) {
try {
$venta = $ventaService->getById($venta_id);
/*$output['venta'] = [
'id' => $venta->id,
''
];*/
$output['venta'] = $venta;
$this->saveRedis($redisService, $redisKey, $output['venta']);
} catch (Exception\EmptyResult) {}

View File

@ -2,6 +2,7 @@
namespace Incoviba\Repository;
use PDO;
use Psr\Log\LoggerInterface;
use Incoviba\Common\Ideal;
use Incoviba\Common\Define;
use Incoviba\Common\Implement;
@ -12,6 +13,7 @@ class Venta extends Ideal\Repository
{
public function __construct(
Define\Connection $connection,
protected LoggerInterface $logger,
protected Venta\Propietario $propietarioRepository,
protected Venta\Propiedad $propiedadRepository,
protected Service\Venta\Pie $pieService,
@ -373,7 +375,8 @@ class Venta extends Ideal\Repository
->joined('JOIN (SELECT ev1.* FROM estado_venta ev1 JOIN (SELECT MAX(id) AS id, venta FROM estado_venta GROUP BY venta) ev0 ON ev0.id = ev1.id) ev ON ev.venta = venta.id')
->joined('JOIN tipo_estado_venta tev ON ev.estado = tev.id')
->where('venta.id = ?')
->group('venta.id');
->order('tu.orden')
->limit(1);
return $this->connection->execute($query, [$venta_id])->fetch(PDO::FETCH_ASSOC);
}
public function fetchByIdForList(int $venta_id): array