mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Fixed "__partLot already defined" error when using a between filter for amountSum on postgres
This commit is contained in:
parent
8f631cae63
commit
c780c0bd92
1 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue