diff --git a/plugins/Html.php b/plugins/Html.php index a589b83..9daa28a 100644 --- a/plugins/Html.php +++ b/plugins/Html.php @@ -216,10 +216,10 @@ eof; eof; } - //中间显示 10 页 + //包括当前页一共显示 10 页 $otherLinks = ''; - $startPage = $page > 5 ? $page - 5 : 1; - $endPage = $startPage + 10 < $maxPage ? $startPage + 10 : $maxPage; + $startPage = floor(($page-1) / 10)*10 + 1; + $endPage = $startPage + 9 < $maxPage ? $startPage + 9 : $maxPage; for ($i = $startPage; $i <= $endPage; $i ++) { $url = self::getPaginationLink($currentUrl, $i, $limit); if ($i != $page) { @@ -241,9 +241,6 @@ eof; {$previousLink} {$otherLinks} {$nextLink} -