mirror of
https://github.com/kokororin/typecho-plugin-Access.git
synced 2024-12-26 21:00:17 +08:00
fix: pagination total should always larger than 0
This commit is contained in:
parent
74f2c32cbb
commit
fd1616d7e7
@ -93,7 +93,7 @@ class Access_Logs {
|
||||
$resp['pagination'] = [
|
||||
'size' => $pageSize,
|
||||
'current' => $pageNum,
|
||||
'total' => floor($resp['count'] / $pageSize),
|
||||
'total' => max(floor($resp['count'] / $pageSize), 1),
|
||||
];
|
||||
$resp['logs'] = $this->db->fetchAll($dataQuery);
|
||||
foreach ($resp['logs'] as &$row) {
|
||||
@ -167,7 +167,7 @@ class Access_Logs {
|
||||
|
||||
$resp['count'] = $this->db->fetchAll($counterQuery)[0]['count'];
|
||||
// delete more than one page requires 2nd time confirmation
|
||||
if ($resp['count'] <= $this->config->pageSize || $force) {
|
||||
if ($resp['count'] <= $this->config->pageSize || $force === 'force') {
|
||||
$this->db->query($operatorQuery);
|
||||
} else {
|
||||
$resp['requireForce'] = true;
|
||||
|
Loading…
Reference in New Issue
Block a user