fix(dashboard): use max price for priciest gas

This commit is contained in:
2026-08-01 22:35:29 +02:00
parent 8a0a94f26e
commit 6a3709504e
@@ -26,7 +26,7 @@ class DashboardService
$gas = $this->repository->retrieveGas(); $gas = $this->repository->retrieveGas();
$gNow = $gas->whereBetween('startDate', [$now->copy()->setHour(0), $now])->first(); $gNow = $gas->whereBetween('startDate', [$now->copy()->setHour(0), $now])->first();
$gCheapest = $gas->where('totalPriceTaxIncluded', $gas->min('totalPriceTaxIncluded'))->first(); $gCheapest = $gas->where('totalPriceTaxIncluded', $gas->min('totalPriceTaxIncluded'))->first();
$gPriciest = $gas->where('totalPriceTaxIncluded', $gas->min('totalPriceTaxIncluded'))->first(); $gPriciest = $gas->where('totalPriceTaxIncluded', $gas->max('totalPriceTaxIncluded'))->first();
return new DashboardData( return new DashboardData(
$eNow, $eNow,