Support to search for numbers

This commit is contained in:
Daniele Scasciafratte
2020-05-07 19:25:13 +02:00
committed by Fonata
parent 260de6126c
commit 33f0b6aa7c

View File

@@ -1108,6 +1108,8 @@ class Csv {
'is greater than or equals',
'contains',
'does not contain',
'is number',
'is not number',
);
$operators_regex = array();
@@ -1149,6 +1151,10 @@ class Csv {
$op_equals = in_array($op, ['=', 'equals', 'is'], true);
if ($op_equals && $row[$field] == $value) {
return '1';
} elseif ($op_equals && $value == 'number' && is_numeric($row[$field])) {
return '1';
} elseif (($op == '!=' || $op == 'is not') && $value == 'number' && !is_numeric($row[$field])) {
return '1';
} elseif (($op == '!=' || $op == 'is not') && $row[$field] != $value) {
return '1';
} elseif (($op == '<' || $op == 'is less than') && $row[$field] < $value) {