From 10d2d6ed4437905fbcad8a93eb76977e3fc0b646 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Sat, 11 Sep 2021 13:35:27 +0300 Subject: [PATCH] Admin: Fixed the critical error that was been caused by outdated function findCount() --- Web/Presenters/AdminPresenter.php | 4 ++-- Web/Presenters/templates/Admin/Users.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Web/Presenters/AdminPresenter.php b/Web/Presenters/AdminPresenter.php index 0465f036..0bc857e6 100644 --- a/Web/Presenters/AdminPresenter.php +++ b/Web/Presenters/AdminPresenter.php @@ -21,8 +21,8 @@ final class AdminPresenter extends OpenVKPresenter $query = $this->queryParam("q") ?? ""; $page = (int) ($this->queryParam("p") ?? 1); - $count = $repo->findCount($query); - return $repo->find($query, $page); + $count = $repo->find($query)->size(); + return $repo->find($query)->page($page, 20); } function onStartup(): void diff --git a/Web/Presenters/templates/Admin/Users.xml b/Web/Presenters/templates/Admin/Users.xml index 17baab8d..9b25a62b 100644 --- a/Web/Presenters/templates/Admin/Users.xml +++ b/Web/Presenters/templates/Admin/Users.xml @@ -58,7 +58,7 @@
- {var isLast = ((10 * (($_GET['p'] ?? 1) - 1)) + $amount) < $count} + {var isLast = ((20 * (($_GET['p'] ?? 1) - 1)) + $amount) < $count} ⭁ туда