From 0ab54aac78154d4379a04b364aad6663d298ef1b Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Tue, 20 Sep 2022 18:25:48 +0800 Subject: [PATCH] fix: 6926a6f9128e608e2851437a85ecd64a226ab1b1 --- web/app/models/Paginator.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/app/models/Paginator.php b/web/app/models/Paginator.php index 4578071..325c874 100644 --- a/web/app/models/Paginator.php +++ b/web/app/models/Paginator.php @@ -16,10 +16,11 @@ class Paginator { $this->cur_start = 0; $this->table = $config['data']; } elseif (!isset($config['echo_full'])) { - if (!isset($config['pagination_table'])) { - $config['pagination_table'] = $config['table']; + $table = $config['table_name']; + if (isset($config['pagination_table'])) { + $table = $config['pagination_table']; } - $this->n_rows = DB::selectCount("select count(*) from {$config['pagination_table']} where {$config['cond']}"); + $this->n_rows = DB::selectCount("select count(*) from {$table} where {$config['cond']}"); $this->page_len = isset($config['page_len']) ? $config['page_len'] : 10;