Open marcelloh opened 7 years ago
There's a trailing space in the array key:
$aFilter['myField != ' ];
If you remove the space, it should work:
$aFilter['myField !=' ];
Happy to see, that there is somehow a solution. I have to test this, but if it is like this, I would say it is an issue
Just tested it. Nice workaround :-) and it will do for now, but I consider it a bug.
The solution: Query.php ->parseWhereToSQLFragments was:
// Column name with comparison operator
$colData = explode(' ', $column);
becomes:
// Column name with comparison operator
$colData = explode(' ', trim($column));
I don't consider it a huge bug, but it doesn't hurt to create a PR with this modification.
I have this code:
and it works but when I add another filter:
It doesn't work. I get a: Unsupported operator '' in WHERE clause. If you want to use a custom operator, you can add one with \Spot\Query::addWhereOperator('', function (QueryBuilder $builder, $column, $value) { ... });