From 954edb231e9e4244f3615780d1ff9a5407fa786b Mon Sep 17 00:00:00 2001 From: "Pedro X." Date: Tue, 19 Sep 2023 12:25:52 +0100 Subject: [PATCH] add model table prefix --- src/app/Library/CrudPanel/Traits/Query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/Library/CrudPanel/Traits/Query.php b/src/app/Library/CrudPanel/Traits/Query.php index d82790b306..2d4b388c40 100644 --- a/src/app/Library/CrudPanel/Traits/Query.php +++ b/src/app/Library/CrudPanel/Traits/Query.php @@ -258,7 +258,7 @@ private function getCountFromQuery(Builder $query) $subQuery = $crudQuery->cloneWithout(['columns', 'orders', 'limit', 'offset']); // select minimum possible columns for the count - $minimumColumns = ($crudQuery->groups || $crudQuery->havings) ? '*' : $modelTable.'.'.$this->model->getKeyName(); + $minimumColumns = ($crudQuery->groups || $crudQuery->havings) ? $modelTable.'.*' : $modelTable.'.'.$this->model->getKeyName(); $subQuery->select($minimumColumns); // in case there are raw expressions we need to add them too.