[DB] Fix bug in custom criteria format wrangling

This commit is contained in:
Hugo Sales 2021-04-16 15:55:50 +00:00
parent e834ac2c8d
commit 19850b5e0d
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -113,7 +113,12 @@ abstract class DB
foreach ($criteria as $op => $exp) { foreach ($criteria as $op => $exp) {
if ($op == 'or' || $op == 'and') { if ($op == 'or' || $op == 'and') {
$method = "{$op}X"; $method = "{$op}X";
return $eb->{$method}(...self::buildExpression($eb, $exp)); $expr = self::buildExpression($eb, $exp);
if (is_array($expr)) {
return $eb->{$method}(...$expr);
} else {
return $eb->{$method}($expr);
}
} elseif ($op == 'is_null') { } elseif ($op == 'is_null') {
$expressions[] = $eb->isNull($exp); $expressions[] = $eb->isNull($exp);
} else { } else {