Weak hands cannot be planted, meager skills have no foundation. Shallow wisdom is futile, how can one hope for a good name?扰扰从役倦，屑屑身事微。少壮轻年月，迟暮惜光辉。
<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?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'