mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-30 05:24:28 +02:00
Only add the amountSum select for part tables if it is really required
This commit is contained in:
parent
c635637c00
commit
a72a61091a
2 changed files with 21 additions and 10 deletions
|
@ -135,6 +135,10 @@ class TwoStepORMAdapter extends ORMAdapter
|
|||
|
||||
protected function getCount(QueryBuilder $queryBuilder, $identifier): int
|
||||
{
|
||||
if ($this->query_modifier !== null) {
|
||||
$queryBuilder = $this->query_modifier->__invoke(clone $queryBuilder);
|
||||
}
|
||||
|
||||
//Check if the queryBuilder is having a HAVING clause, which would make the count query invalid
|
||||
if (empty($queryBuilder->getDQLPart('having'))) {
|
||||
//If not, we can use the simple count query
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue