Files
opensem/app/Repositories/Shop/Dashboards.php
Ludovic CANDELLIER b8c31f6049 fix shipping
2023-07-16 17:54:44 +02:00

21 lines
732 B
PHP

<?php
namespace App\Repositories\Shop;
class Dashboards
{
public static function getStats($start, $end)
{
return [
'orders_count' => OrderMetrics::countByPeriod($start, $end),
'orders_sum' => OrderMetrics::sumByPeriod($start, $end, 'total_shipped'),
'orders_avg' => OrderMetrics::avgByPeriod($start, $end, 'total_shipped'),
'offers_count' => Offers::count(),
'clients_count' => Customers::count(),
'preparationLess24H' => OrderMetrics::countInPreparationLess24H(),
'preparationLess48H' => OrderMetrics::countInPreparationLess48H(),
'preparationMore48H' => OrderMetrics::countInPreparationMore48H(),
];
}
}