filters improvements

This commit is contained in:
2023-11-17 20:21:45 +02:00
parent cfde3bf501
commit 794916b178
17 changed files with 387 additions and 241 deletions
+2 -2
View File
@@ -34,6 +34,7 @@ final class FilterParser
{
$operator = $this->detectOperator($filter);
$field = $this->detectField($filter, $operator);
$formattedValue = match ($operator) {
"eq" => $this->formatText($value),
@@ -61,7 +62,6 @@ final class FilterParser
default => $value,
};
$matchedOperator = Operator::list()[$operator];
return new Argument(
field: str_replace(".", "->", $field),
@@ -134,6 +134,7 @@ final class FilterParser
return $c;
}, []);
$sourceIds = collect($subqueries)->reduce(function ($c, $subquery, $k) {
$query = $this->app->make(Query::class);
@@ -197,7 +198,6 @@ final class FilterParser
*/
private function parseAnd(Builder $builder, array $arguments): Builder
{
foreach ($arguments as $argument) {
if ($argument->operator == "in") {
$builder->whereIn($argument->field, $argument->value);