Aggiunto calcolo automatico pages per API

This commit is contained in:
Dasc3er 2020-11-13 18:33:18 +01:00
parent bfd7e27556
commit 63e1909f8d
1 changed files with 4 additions and 1 deletions

View File

@ -146,7 +146,10 @@ class Manager
$count = $database->fetchNum($query, $parameters);
$response['total-count'] = $count;
$response['pages'] = intval(ceil($count / $length));
}
if (empty($response['pages'])) {
$response['pages'] = intval(ceil($response['total-count'] / $length));
}
} catch (PDOException $e) {
// Log dell'errore