Fix on invoices, add delivery reference, wip on dashboard concurrency requests designed on template

This commit is contained in:
Ludovic CANDELLIER
2023-02-17 00:05:03 +01:00
parent 820a200e88
commit 900aa413a2
26 changed files with 555 additions and 130 deletions

View File

@@ -7,12 +7,17 @@ use App\Models\Shop\Homepage;
class Dashboards
{
public static function getStats()
public static function getStats($start, $end)
{
return [
'orders_count' => Orders::countByMonth(),
'orders_sum' => Orders::sumByMonth(),
'orders_avg' => Orders::avgByMonth(),
'orders_count' => Orders::countByPeriod($start, $end),
'orders_sum' => Orders::sumByPeriod($start, $end, 'total_shipped'),
'orders_avg' => Orders::avgByPeriod($start, $end, 'total_shipped'),
'offers_count' => Offers::count(),
'clients_count' => Customers::count(),
'preparationLess24H' => Orders::countInPreparationLess24H(),
'preparationLess48H' => Orders::countInPreparationLess48H(),
'preparationMore48H' => Orders::countInPreparationMore48H(),
];
}
}