1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-06 02:33:27 +01:00

Aggiunto calcolo automatico pages per API

This commit is contained in:
Dasc3er 2020-11-13 18:33:18 +01:00
parent bfd7e27556
commit 63e1909f8d

View File

@ -146,7 +146,10 @@ class Manager
$count = $database->fetchNum($query, $parameters); $count = $database->fetchNum($query, $parameters);
$response['total-count'] = $count; $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) { } catch (PDOException $e) {
// Log dell'errore // Log dell'errore