private function jqFilterQuery()
    {
        if (($filter = \Input::get('filter')) && is_array($filter)) {
            $this->setJqGridQuery($this->jqGridQuery->where(function ($query) use ($filter) {
                foreach ($filter as $k => $val) {
                    $field = $this->getJqFilterField($k);

                    if (is_array($val)) {
                        $query->where(function ($query) use ($val, $field) {
                            foreach ($val as $v) {
                                if (!$this->isExcluded($v)) {
                                    $query->orWhere($field, '=', $v);
                                }
                            }
                        });
                    } else {
                        if (!$val) {
                            if (!$this->isExcluded($val)) {
                                $query->where($field, '=', null);
                            }
                        } else {
                            if (!$this->isExcluded($val)) {
                                $query->where($field, '=', $val);
                            }
                        }
                    }
                }
            }));
        }

        return $this;
    }