diff --git a/modules/anagrafiche/src/API/v1/Anagrafiche.php b/modules/anagrafiche/src/API/v1/Anagrafiche.php index 0a0f954cb..f82b859e1 100755 --- a/modules/anagrafiche/src/API/v1/Anagrafiche.php +++ b/modules/anagrafiche/src/API/v1/Anagrafiche.php @@ -93,11 +93,13 @@ class Anagrafiche extends Resource implements RetrieveInterface, CreateInterface $query = $query->havingRaw($having); } + $total_count = $query->count(); + return [ 'results' => $query->skip($request['page'] * $request['length']) ->limit($request['length']) ->get()->toArray(), - 'total-count' => $query->count(), + 'total-count' => $total_count, ]; }