Skip to content
Snippets Groups Projects
Commit c2da22a1 authored by Адлан Шамавов's avatar Адлан Шамавов
Browse files

fix: Доработан фильтр Range

parent 8acd5694
No related branches found
No related tags found
1 merge request!1Фильтры Like, ILike, Range, In, Date, DateRange
......@@ -13,13 +13,14 @@ final class Range extends HttpFilter
/** @throws FilterParameterValueIsNullException */
public function addToQuery(QueryBuilder $queryBuilder): QueryBuilder
{
if (! isset($this->getHttpValue()['min']) && ! isset($this->getHttpValue()['max'])) {
if ((! isset($this->getHttpValue()['min']) && ! isset($this->getHttpValue()['max']))
|| (! is_numeric($this->getHttpValue()['min']) && ! is_numeric($this->getHttpValue()['max']))) {
throw new FilterParameterValueIsNullException($this->field);
}
if (isset($this->getHttpValue()['min'])) {
$queryBuilder->where(
$this->getColumn() . '>= ' . $this->getHttpValue()['min']
$this->getColumn() . ' >= ' . $this->getHttpValue()['min']
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment