add metrics
This commit is contained in:
32
app/Repositories/Shop/CustomerMetrics.php
Normal file
32
app/Repositories/Shop/CustomerMetrics.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Customer;
|
||||
use App\Repositories\Core\DateStats;
|
||||
use App\Traits\Model\Basic;
|
||||
|
||||
class CustomerMetrics
|
||||
{
|
||||
use Basic, DateStats;
|
||||
|
||||
public static function countOfToday()
|
||||
{
|
||||
return Customer::ofToday()->count();
|
||||
}
|
||||
|
||||
public static function countOfLastWeek()
|
||||
{
|
||||
return Customer::ofLastWeek()->count();
|
||||
}
|
||||
|
||||
public static function countOfLastMonth()
|
||||
{
|
||||
return Customer::ofLastMonth()->count();
|
||||
}
|
||||
|
||||
public static function getModel()
|
||||
{
|
||||
return Customer::query();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user