FIX: all sociedades & allActive depositos
This commit is contained in:
@ -42,7 +42,7 @@ class Contabilidad extends Controller
|
|||||||
$inmobiliarias = $this->fetchRedis($redisService, $redisKey);
|
$inmobiliarias = $this->fetchRedis($redisService, $redisKey);
|
||||||
} catch (EmptyRedis) {
|
} catch (EmptyRedis) {
|
||||||
try {
|
try {
|
||||||
$inmobiliarias = $inmobiliariaRepository->fetchAllActive();
|
$inmobiliarias = $inmobiliariaRepository->fetchAll();
|
||||||
$this->saveRedis($redisService, $redisKey, $inmobiliarias, 30 * 24 * 60 * 60);
|
$this->saveRedis($redisService, $redisKey, $inmobiliarias, 30 * 24 * 60 * 60);
|
||||||
} catch (EmptyResult) {}
|
} catch (EmptyResult) {}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Incoviba\Repository;
|
namespace Incoviba\Repository;
|
||||||
|
|
||||||
|
use DateTimeImmutable;
|
||||||
use Incoviba\Common\Define;
|
use Incoviba\Common\Define;
|
||||||
use Incoviba\Common\Ideal;
|
use Incoviba\Common\Ideal;
|
||||||
use Incoviba\Common\Implement;
|
use Incoviba\Common\Implement;
|
||||||
@ -51,4 +52,13 @@ class Deposito extends Ideal\Repository
|
|||||||
->where('cuenta_id = ?');
|
->where('cuenta_id = ?');
|
||||||
return $this->fetchMany($query, [$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