FIX: objeto ->array
This commit is contained in:
@ -88,7 +88,7 @@ class Nubox extends Ideal\Service
|
|||||||
{
|
{
|
||||||
$redisKey = "nubox:cuentas:{$inmobiliaria_rut}";
|
$redisKey = "nubox:cuentas:{$inmobiliaria_rut}";
|
||||||
try {
|
try {
|
||||||
return json_decode($this->redisService->get($redisKey));
|
return json_decode($this->redisService->get($redisKey), JSON_OBJECT_AS_ARRAY);
|
||||||
} catch (Exception\EmptyRedis) {
|
} catch (Exception\EmptyRedis) {
|
||||||
$today = new DateTimeImmutable();
|
$today = new DateTimeImmutable();
|
||||||
$libro = $this->getLibroMayor($inmobiliaria_rut, new DateTimeImmutable($today->format('Y-m-1')), new DateTimeImmutable($today->format('Y-m-t')));
|
$libro = $this->getLibroMayor($inmobiliaria_rut, new DateTimeImmutable($today->format('Y-m-1')), new DateTimeImmutable($today->format('Y-m-t')));
|
||||||
@ -105,12 +105,12 @@ class Nubox extends Ideal\Service
|
|||||||
{
|
{
|
||||||
$cuentas = $this->getCuentas($inmobiliaria_rut);
|
$cuentas = $this->getCuentas($inmobiliaria_rut);
|
||||||
$validas = array_filter($cuentas, function($cuenta) use ($cuentaNombre) {
|
$validas = array_filter($cuentas, function($cuenta) use ($cuentaNombre) {
|
||||||
return strtolower($cuenta->nombre) === strtolower($cuentaNombre);
|
return strtolower($cuenta['nombre']) === strtolower($cuentaNombre);
|
||||||
});
|
});
|
||||||
if (count($validas) === 0) {
|
if (count($validas) === 0) {
|
||||||
throw new Exception\EmptyResult('Cuenta no encontrada');
|
throw new Exception\EmptyResult('Cuenta no encontrada');
|
||||||
}
|
}
|
||||||
return array_values($validas)[0]->codigo;
|
return array_values($validas)[0]['codigo'];
|
||||||
}
|
}
|
||||||
public function getLibroMayor(int $inmobiliaria_rut, DateTimeInterface $from, DateTimeInterface $to): array
|
public function getLibroMayor(int $inmobiliaria_rut, DateTimeInterface $from, DateTimeInterface $to): array
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user