X7ROOT File Manager
Current Path:
/home/katmhsmi/public_html/wp-content/plugins/wp-statistics/src/Models
home
/
katmhsmi
/
public_html
/
wp-content
/
plugins
/
wp-statistics
/
src
/
Models
/
📁
..
📄
AuthorsModel.php
(13.25 KB)
📄
EventsModel.php
(8.38 KB)
📄
ExclusionsModel.php
(1.49 KB)
📄
HistoricalModel.php
(6.87 KB)
📄
OnlineModel.php
(1.89 KB)
📄
PostsModel.php
(16.15 KB)
📄
TaxonomyModel.php
(7.28 KB)
📄
ViewsModel.php
(12.88 KB)
📄
VisitorsModel.php
(55.94 KB)
Editing: ExclusionsModel.php
<?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; } }
Upload File
Create Folder