重写分页方法
This commit is contained in:
parent
f8a97527f6
commit
ac74827130
@ -1,7 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace catcher;
|
namespace catcher;
|
||||||
|
|
||||||
|
use catcher\base\CatchModel;
|
||||||
use think\db\Query;
|
use think\db\Query;
|
||||||
|
use think\Paginator;
|
||||||
|
|
||||||
class CatchQuery extends Query
|
class CatchQuery extends Query
|
||||||
{
|
{
|
||||||
@ -161,4 +163,15 @@ class CatchQuery extends Query
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function paginate($listRows = null, $simple = false): Paginator
|
||||||
|
{
|
||||||
|
if (!$listRows) {
|
||||||
|
$limit = \request()->param('limit');
|
||||||
|
|
||||||
|
$listRows = $limit ? : CatchModel::LIMIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::paginate($listRows, $simple); // TODO: Change the autogenerated stub
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user