mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Fix page offsets
This commit is contained in:
@@ -102,6 +102,7 @@ class ProdOrderController extends BaseOrderController
|
||||
$page = (int) $request->query->get('page', 1);
|
||||
$perPage = (int) $request->query->get('per-page', 10);
|
||||
$offsetStart = 0;
|
||||
|
||||
if ($page > 0) {
|
||||
$offsetStart = ($page - 1) * $perPage;
|
||||
}
|
||||
@@ -110,7 +111,7 @@ class ProdOrderController extends BaseOrderController
|
||||
|
||||
$baseIds = array_keys($this->getAclForUser()->get_granted_base(['order_master']));
|
||||
|
||||
$ordersList = $this->getOrderRepository()->listOrders($baseIds, $offsetStart * $perPage, $perPage, $sort);
|
||||
$ordersList = $this->getOrderRepository()->listOrders($baseIds, $offsetStart, $perPage, $sort);
|
||||
$total = $this->getOrderRepository()->countTotalOrders($baseIds);
|
||||
|
||||
return $this->render('prod/orders/order_box.html.twig', [
|
||||
|
Reference in New Issue
Block a user