Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into qodana-automation-1753957859
Browse files Browse the repository at this point in the history
  • Loading branch information
phily245 committed Nov 6, 2024
2 parents 213d497 + 9e57f24 commit a60e618
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Filters/BooleanFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace UKFast\Sieve\Filters;

use Illuminate\Database\Query\Builder;
use UKFast\Sieve\ModifiesQueries;
use UKFast\Sieve\SearchTerm;

Expand All @@ -14,17 +13,17 @@ public function __construct(protected $trueVal = 1, protected $falseVal = 0)

public function modifyQuery($query, SearchTerm $search): void
{
$op = '=';
$operator = '=';
if ($search->operator() == 'neq') {
$op = '!=';
$operator = '!=';
}

$searchTerm = true;
if ($search->term() == 'false') {
$searchTerm = false;
}

$query->where($search->column(), $op, $searchTerm ? $this->trueVal : $this->falseVal);
$query->where($search->column(), $operator, $searchTerm ? $this->trueVal : $this->falseVal);
}

public function operators(): array
Expand Down

0 comments on commit a60e618

Please sign in to comment.