src/PHPDish/Bundle/AdminBundle/Grid/Grid.php
protected function applyFilters(array $filterItems)
    {
        foreach ($filterItems as $columnName => $filterItem) {
            if (is_numeric($columnName)) {
                if (!is_array($filterItem)) {  //不是符合条件的filter格式，跳过
                    continue;
                }
                $columnName = $filterItem['column'];
            } else {
                //key-value 模式,只能是input filter
                $filterItem = [
                    'column' => $columnName,
                    'operator' => null,
                    'value' => $filterItem
                ];
            }

            //如果没有该列则跳过
            if (!$this->hasColumn($columnName)) {
                continue;
            }

            $column = $this->getColumn($columnName);
            if ($filter = $column->getFilterByOperator($filterItem['operator'])) {
                $filter->initialize($filterItem);
            }
        }
    }
protected function applyFilters(array $filterItems)
    {
        foreach ($filterItems as $columnName => $filterItem) {
            if (is_numeric($columnName)) {
                if (!is_array($filterItem)) {  //不是符合条件的filter格式，跳过
                    continue;
                }
                $columnName = $filterItem['column'];
            } else {
                //key-value 模式,只能是input filter
                $filterItem = [
                    'column' => $columnName,
                    'operator' => null,
                    'value' => $filterItem
                ];
            }

            //如果没有该列则跳过
            if (!$this->hasColumn($columnName)) {
                continue;
            }

            $column = $this->getColumn($columnName);
            if ($filter = $column->getFilterByOperator($filterItem['operator'])) {
                $filter->initialize($filterItem);
            }
        }
    }
[
'filters' => [
['column' => 'age', 'operator' => 'lt', 'value' => 18],
['column' => 'age', 'operator' => 'gt', 'value' => 5],
['column' => 'age', 'operator' => 'between', 'from' => 5, to => 18],
'username' => 'slince',
]
]
@param array $filterItems