21 lines
696 B
PHP
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(),
|
|
];
|
|
}
|
|
}
|