Corrections for the return of the Gross Monthly Economy api tracing the missing months.

This commit is contained in:
Djonathan 2022-06-30 12:35:36 -03:00
parent 0ad3f0cf8a
commit a0727ee2b4

View File

@ -70,7 +70,7 @@ class EconomyRepository extends AbstractRepository implements EconomyContractInt
->orderBy('dad_estimado')
->get();
return collect($result)->transform(fn($value) => Arr::set($value, 'mes', date_format(date_create($value['mes']), "m/Y")))->all();
return collect(static::checkDate($result))->transform(fn($value) => Arr::set($value, 'mes', date_format(date_create($value['mes']), "M/Y")))->all();
}
@ -118,7 +118,7 @@ class EconomyRepository extends AbstractRepository implements EconomyContractInt
->orderBy('dad_estimado')
->get();
return collect(static::checkDate($result))->transform(fn($value) => Arr::set($value, 'mes', date_format(date_create($value['mes']), "M/Y")))->all();;
return collect(static::checkDate($result))->transform(fn($value) => Arr::set($value, 'mes', date_format(date_create($value['mes']), "M/Y")))->all();
}