fix:修复BUG/升级1.1.6版本

This commit is contained in:
Ying
2023-04-25 20:11:49 +08:00
parent 445e5f9662
commit 6a6866bbaf
2357 changed files with 456920 additions and 140567 deletions

View File

@@ -1,8 +1,9 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
@@ -14,19 +15,19 @@ namespace think\paginator\driver;
use think\Paginator;
/**
* Bootstrap 分页驱动
* Bootstrap 分页驱动.
*/
class Bootstrap extends Paginator
{
/**
* 上一页按钮
* 上一页按钮.
*
* @param string $text
*
* @return string
*/
protected function getPreviousButton(string $text = "&laquo;"): string
protected function getPreviousButton(string $text = '&laquo;'): string
{
if ($this->currentPage() <= 1) {
return $this->getDisabledTextWrapper($text);
}
@@ -39,8 +40,10 @@ class Bootstrap extends Paginator
}
/**
* 下一页按钮
* 下一页按钮.
*
* @param string $text
*
* @return string
*/
protected function getNextButton(string $text = '&raquo;'): string
@@ -55,7 +58,8 @@ class Bootstrap extends Paginator
}
/**
* 页码按钮
* 页码按钮.
*
* @return string
*/
protected function getLinks(): string
@@ -70,21 +74,21 @@ class Bootstrap extends Paginator
'last' => null,
];
$side = 3;
$side = 3;
$window = $side * 2;
if ($this->lastPage < $window + 6) {
$block['first'] = $this->getUrlRange(1, $this->lastPage);
} elseif ($this->currentPage <= $window) {
$block['first'] = $this->getUrlRange(1, $window + 2);
$block['last'] = $this->getUrlRange($this->lastPage - 1, $this->lastPage);
$block['last'] = $this->getUrlRange($this->lastPage - 1, $this->lastPage);
} elseif ($this->currentPage > ($this->lastPage - $window)) {
$block['first'] = $this->getUrlRange(1, 2);
$block['last'] = $this->getUrlRange($this->lastPage - ($window + 2), $this->lastPage);
$block['last'] = $this->getUrlRange($this->lastPage - ($window + 2), $this->lastPage);
} else {
$block['first'] = $this->getUrlRange(1, 2);
$block['first'] = $this->getUrlRange(1, 2);
$block['slider'] = $this->getUrlRange($this->currentPage - $side, $this->currentPage + $side);
$block['last'] = $this->getUrlRange($this->lastPage - 1, $this->lastPage);
$block['last'] = $this->getUrlRange($this->lastPage - 1, $this->lastPage);
}
$html = '';
@@ -107,7 +111,8 @@ class Bootstrap extends Paginator
}
/**
* 渲染分页html
* 渲染分页html.
*
* @return mixed
*/
public function render()
@@ -131,10 +136,11 @@ class Bootstrap extends Paginator
}
/**
* 生成一个可点击的按钮
* 生成一个可点击的按钮.
*
* @param string $url
* @param string $page
*
* @param string $url
* @param string $page
* @return string
*/
protected function getAvailablePageWrapper(string $url, string $page): string
@@ -143,9 +149,10 @@ class Bootstrap extends Paginator
}
/**
* 生成一个禁用的按钮
* 生成一个禁用的按钮.
*
* @param string $text
*
* @param string $text
* @return string
*/
protected function getDisabledTextWrapper(string $text): string
@@ -154,9 +161,10 @@ class Bootstrap extends Paginator
}
/**
* 生成一个激活的按钮
* 生成一个激活的按钮.
*
* @param string $text
*
* @param string $text
* @return string
*/
protected function getActivePageWrapper(string $text): string
@@ -165,7 +173,7 @@ class Bootstrap extends Paginator
}
/**
* 生成省略号按钮
* 生成省略号按钮.
*
* @return string
*/
@@ -177,7 +185,8 @@ class Bootstrap extends Paginator
/**
* 批量生成页码按钮.
*
* @param array $urls
* @param array $urls
*
* @return string
*/
protected function getUrlLinks(array $urls): string
@@ -192,10 +201,11 @@ class Bootstrap extends Paginator
}
/**
* 生成普通页码按钮
* 生成普通页码按钮.
*
* @param string $url
* @param string $page
*
* @param string $url
* @param string $page
* @return string
*/
protected function getPageLinkWrapper(string $url, string $page): string