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;
|
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)
|
return collect($result)
|
||||||
->transform(fn($value) => Arr::set(
|
->transform(fn($value) => Arr::set(
|
||||||
$value,
|
$value,
|
||||||
$field,
|
$field,
|
||||||
Carbon::createFromFormat($old_format, $value[$field])->locale('pt-BR')
|
Carbon::createFromFormat('ym', $value[$field])->locale('pt-BR')
|
||||||
->translatedFormat($format)))
|
->translatedFormat($format)))
|
||||||
->all();
|
->all();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -153,9 +153,7 @@ class EconomyRepository extends AbstractRepository implements EconomyContractInt
|
|||||||
->orderBy(DB::raw("mes, dad_estimado"))
|
->orderBy(DB::raw("mes, dad_estimado"))
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
$result = Helpers::checkDate($value);
|
return Helpers::checkDate($value);
|
||||||
|
|
||||||
return Helpers::orderByDate($result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user