Skip to content

Commit

Permalink
fix optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed May 1, 2021
1 parent 710d3c4 commit a42c620
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Model/Scope/Condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,12 @@ public function toQueryArguments(): array

foreach (array_reverse($refModels) as $refModel) {
if ($field === '#') {
$field = $value ? $refModel->action('count') : $refModel->action('exists');
if ($value === 0) {
$field = $refModel->action('exists');
$value = false;
} else {
$field = $refModel->action('count');
}
} else {
$refModel->addCondition($field, $operator, $value);
$field = $refModel->action('exists');
Expand Down

0 comments on commit a42c620

Please sign in to comment.