Skip to content
Snippets Groups Projects
Commit a1113dce authored by Dmytro Novikov's avatar Dmytro Novikov Committed by Nikolay Ignatov
Browse files

Issue #2879848 by sedax, d.novikov: Added BETWEEN and NOT BETWEEN

parent 99059646
No related branches found
No related tags found
No related merge requests found
......@@ -121,6 +121,36 @@ class FilterFactory {
];
break;
case 'BETWEEN':
$filter = [
'range' => [
$condition->getField() => [
'from' => (!empty($condition->getValue()[0])) ? $condition->getValue()[0] : NULL,
'to' => (!empty($condition->getValue()[1])) ? $condition->getValue()[1] : NULL,
'include_lower' => FALSE,
'include_upper' => FALSE,
],
],
];
break;
case 'NOT BETWEEN':
$filter = [
'bool' => [
'must_not' => [
'range' => [
$condition->getField() => [
'from' => (!empty($condition->getValue()[0])) ? $condition->getValue()[0] : NULL,
'to' => (!empty($condition->getValue()[1])) ? $condition->getValue()[1] : NULL,
'include_lower' => FALSE,
'include_upper' => FALSE,
],
],
]
]
];
break;
default:
throw new \Exception('Undefined operator ' . $condition->getOperator() . ' for ' . $condition->getField() . ' field! Incorrect filter criteria is using for searching!');
}
......
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