From c7ed4dbb41aecb7a42a9c74cf2bb36de7b322b88 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 7 Jan 2025 10:34:02 +0100 Subject: [PATCH] Orm/ItemReservation: Use QueryBuilder properly As suggested in https://github.com/nextras/orm/issues/718#issuecomment-2572514904 --- app/Model/Orm/ItemReservation/ItemReservationMapper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Model/Orm/ItemReservation/ItemReservationMapper.php b/app/Model/Orm/ItemReservation/ItemReservationMapper.php index d11310e..c23e4c0 100644 --- a/app/Model/Orm/ItemReservation/ItemReservationMapper.php +++ b/app/Model/Orm/ItemReservation/ItemReservationMapper.php @@ -12,8 +12,8 @@ */ final class ItemReservationMapper extends BaseMapper { public function getStats(): Result { - $query = $this->builder()->select('name')->addSelect('COUNT(*) AS cnt')->groupBy('name')->getQuerySql(); + $builder = $this->builder()->select('name')->addSelect('COUNT(*) AS cnt')->groupBy('name'); - return $this->connection->queryArgs([$query, $this->getTableName()]); + return $this->connection->queryByQueryBuilder($builder); } }