fixed pagination (final page)

This commit is contained in:
fbsanchez 2020-09-11 15:09:52 +02:00
parent 017333c46a
commit da7f286b22
1 changed files with 9 additions and 1 deletions

View File

@ -323,11 +323,19 @@ class Group extends Entity
}
}
if ($step > 2) {
$processed = (($step - 2) * $limit);
} else {
$processed = 0;
}
$current_ammount = (count($return) + $processed);
echo json_encode(
[
'results' => $return,
'pagination' => [
'more' => (count($return) + (($step - 2) * $limit)) < $count,
'more' => $current_ammount < $count,
],
]
);