Fixed "__partLot already defined" error when using a between filter for amountSum on postgres

This commit is contained in:
Jan Böhmer 2024-06-22 19:03:30 +02:00
parent 8f631cae63
commit c780c0bd92

View file

@ -105,7 +105,13 @@ class NumberConstraint extends AbstractConstraint
} }
$this->addSimpleAndConstraint($queryBuilder, $this->property, $this->identifier . '1', '>=', $this->value1); $this->addSimpleAndConstraint($queryBuilder, $this->property, $this->identifier . '1', '>=', $this->value1);
$this->addSimpleAndConstraint($queryBuilder, $this->property, $this->identifier . '2', '<=', $this->value2);
//Workaround for the amountSum which we need to add twice on postgres. Replace one of the __ with __2 to make it work
//Otherwise we get an error, that __partLot was already defined
$property2 = str_replace('__', '__2', $this->property);
$this->addSimpleAndConstraint($queryBuilder, $property2, $this->identifier . '2', '<=', $this->value2);
} }
} }
} }