Fixed retrieving total record count
This commit is contained in:
parent
932407a571
commit
b4d2c5ecbb
1 changed files with 3 additions and 1 deletions
|
@ -52,7 +52,9 @@ abstract class AbstractSearchService
|
||||||
foreach ($query as $arrayEntity)
|
foreach ($query as $arrayEntity)
|
||||||
$entities[] = $this->entityConverter->toEntity($arrayEntity);
|
$entities[] = $this->entityConverter->toEntity($arrayEntity);
|
||||||
|
|
||||||
$query->select('COUNT(1) AS c');
|
$query = $this->fpdo
|
||||||
|
->from($this->tableName)
|
||||||
|
->select('COUNT(1) AS c');
|
||||||
$totalRecords = intval(iterator_to_array($query)[0]['c']);
|
$totalRecords = intval(iterator_to_array($query)[0]['c']);
|
||||||
return new \Szurubooru\Dao\SearchResult($searchFilter, $entities, $totalRecords);
|
return new \Szurubooru\Dao\SearchResult($searchFilter, $entities, $totalRecords);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue