Function implementation does not work correctly at cost R$/MWh.
This commit is contained in:
parent
ae15694ca6
commit
b13d34a38c
@ -21,13 +21,13 @@ class Helpers
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function orderByDate($result, $old_format = 'Y-m-d', $format ='M/Y', $field = 'mes'): array
|
||||
public static function orderByDate($result, $format ='M/Y', $field = 'mes'): array
|
||||
{
|
||||
return collect($result)
|
||||
->transform(fn($value) => Arr::set(
|
||||
$value,
|
||||
$field,
|
||||
Carbon::createFromFormat($old_format, $value[$field])->locale('pt-BR')
|
||||
Carbon::createFromFormat('ym', $value[$field])->locale('pt-BR')
|
||||
->translatedFormat($format)))
|
||||
->all();
|
||||
}
|
||||
|
||||
@ -153,9 +153,7 @@ class EconomyRepository extends AbstractRepository implements EconomyContractInt
|
||||
->orderBy(DB::raw("mes, dad_estimado"))
|
||||
->get();
|
||||
|
||||
$result = Helpers::checkDate($value);
|
||||
|
||||
return Helpers::orderByDate($result);
|
||||
return Helpers::checkDate($value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user