FIX: all sociedades & allActive depositos
This commit is contained in:
@ -42,7 +42,7 @@ class Contabilidad extends Controller
|
||||
$inmobiliarias = $this->fetchRedis($redisService, $redisKey);
|
||||
} catch (EmptyRedis) {
|
||||
try {
|
||||
$inmobiliarias = $inmobiliariaRepository->fetchAllActive();
|
||||
$inmobiliarias = $inmobiliariaRepository->fetchAll();
|
||||
$this->saveRedis($redisService, $redisKey, $inmobiliarias, 30 * 24 * 60 * 60);
|
||||
} catch (EmptyResult) {}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace Incoviba\Repository;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use Incoviba\Common\Define;
|
||||
use Incoviba\Common\Ideal;
|
||||
use Incoviba\Common\Implement;
|
||||
@ -51,4 +52,13 @@ class Deposito extends Ideal\Repository
|
||||
->where('cuenta_id = ?');
|
||||
return $this->fetchMany($query, [$cuenta_id]);
|
||||
}
|
||||
public function fetchAllActive(): array
|
||||
{
|
||||
$fecha = new DateTimeImmutable();
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select()
|
||||
->from($this->getTable())
|
||||
->where('inicio <= ? AND termino >= ?');
|
||||
return $this->fetchMany($query, [$fecha->format('Y-m-d'), $fecha->format('Y-m-d')]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user