|
Server : LiteSpeed System : Linux quebec.us.hostns.io 5.14.0-687.42.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 27 11:55:12 EDT 2026 x86_64 User : gazetufm ( 1431) PHP Version : 8.1.35 Disable Function : NONE Directory : /home2/gazetufm/dumoshi.com/wp-content/plugins/wp-statistics/src/Models/ | |
|
Path: //home2/gazetufm/dumoshi.com/wp-content/plugins/wp-statistics/src/Models/ExclusionsModel.php
Size: 1.49 KB
Permissions: 0644
<?php
namespace WP_Statistics\Models;
use WP_Statistics\Abstracts\BaseModel;
use WP_Statistics\Utils\Query;
class ExclusionsModel extends BaseModel
{
public function countExclusions($args = [])
{
$args = $this->parseArgs($args, [
'date' => '',
'reason' => ''
]);
$result = Query::select(['SUM(count) as count'])
->from('exclusions')
->where('reason', '=', $args['reason'])
->whereDate('date', $args['date'])
->orderBy('date')
->getVar();
return $result ?? 0;
}
public function getExclusions($args = [])
{
$args = $this->parseArgs($args, [
'date' => '',
'reason' => '',
'exclusion_id' => '',
'per_page' => '',
'page' => 1,
'order_by' => 'count',
'order' => 'DESC',
'group_by' => 'reason',
]);
$result = Query::select([
'reason',
'date',
'SUM(count) as count'
])
->from('exclusions')
->where('reason', '=', $args['reason'])
->where('id', '=', $args['exclusion_id'])
->whereDate('date', $args['date'])
->perPage($args['page'], $args['per_page'])
->groupBy($args['group_by'])
->orderBy($args['order_by'], $args['order'])
->getAll();
return $result;
}
}