public function scopeDate($query, $year = '', $month ='', $day ='')
    {
        if($year) {
            $query->whereMonth($this->getTable().'.created_at', $year);
        }

        if($month) {
            $query->whereYear($this->getTable().'.created_at', $month);
        }

        if($day) {
            $query->whereDay($this->getTable().'.created_at', $day);
        }
        return $query;
    }