Fix that queryfilters are being ignored by the parser
This commit is contained in:
parent
0227c6a49d
commit
e355415164
|
@ -193,8 +193,7 @@ class TreeToSqlParser
|
|||
if ($tree->root == null) {
|
||||
return;
|
||||
}
|
||||
$tree->root = $tree->normalizeTree($tree->root);
|
||||
$sql = $this->nodeToSqlQuery($tree->root);
|
||||
$sql = $this->nodeToSqlQuery($tree->normalizeTree($tree->root));
|
||||
|
||||
if ($this->filtersAggregate()) {
|
||||
$baseQuery->having($sql);
|
||||
|
|
|
@ -232,12 +232,12 @@ class Tree
|
|||
$node->left = $this->removeInvalidFilter($node->left, $filter);
|
||||
$node->right = $this->removeInvalidFilter($node->right, $filter);
|
||||
|
||||
if ($node->left && $node->right) {
|
||||
if ($node->left || $node->right) {
|
||||
if (!$node->left) {
|
||||
$node->left = $node->right;
|
||||
$node->right = null;
|
||||
}
|
||||
return $node;
|
||||
} elseif ($node->left) {
|
||||
return $node->left;
|
||||
} elseif ($node->right) {
|
||||
return $node->right;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -182,6 +182,6 @@ EOT;
|
|||
return '';
|
||||
}
|
||||
$this->buildBaseUrl();
|
||||
return $this->nodeToBadge($this->tree->root);
|
||||
return $this->nodeToBadge(Tree::normalizeTree($this->tree->root));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue