提交的内容
This commit is contained in:
7
vendor/topthink/think-orm/src/Paginator.php
vendored
Executable file → Normal file
7
vendor/topthink/think-orm/src/Paginator.php
vendored
Executable file → Normal file
@ -110,7 +110,7 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J
|
||||
*/
|
||||
protected static $maker;
|
||||
|
||||
public function __construct($items, int $listRows, int $currentPage = 1, int $total = null, bool $simple = false, array $options = [])
|
||||
public function __construct($items, int $listRows, int $currentPage = 1, ?int $total = null, bool $simple = false, array $options = [])
|
||||
{
|
||||
$this->options = array_merge($this->options, $options);
|
||||
|
||||
@ -146,7 +146,7 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J
|
||||
*
|
||||
* @return Paginator
|
||||
*/
|
||||
public static function make($items, int $listRows, int $currentPage = 1, int $total = null, bool $simple = false, array $options = [])
|
||||
public static function make($items, int $listRows, int $currentPage = 1, ?int $total = null, bool $simple = false, array $options = [])
|
||||
{
|
||||
if (isset(static::$maker)) {
|
||||
return call_user_func(static::$maker, $items, $listRows, $currentPage, $total, $simple, $options);
|
||||
@ -339,7 +339,7 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function fragment(string $fragment = null)
|
||||
public function fragment(?string $fragment = null)
|
||||
{
|
||||
$this->options['fragment'] = $fragment;
|
||||
|
||||
@ -531,6 +531,7 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J
|
||||
'current_page' => $this->currentPage(),
|
||||
'last_page' => $this->lastPage,
|
||||
'data' => $this->items->toArray(),
|
||||
'has_more' => $this->hasMore,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user