Files
opensem/app/Repositories/Shop/Dashboards.php
Ludovic CANDELLIER 0879b0abf0 add shipping rules
2023-07-16 14:45:42 +02:00

21 lines
696 B
PHP

<?php
namespace App\Repositories\Shop;
class Dashboards
{
public static function getStats($start, $end)
{
return [
'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(),
];
}
}