重写分页方法

This commit is contained in:
wuyanwen 2020-01-21 17:56:28 +08:00
parent f8a97527f6
commit ac74827130

View File

@ -1,7 +1,9 @@
<?php
namespace catcher;
use catcher\base\CatchModel;
use think\db\Query;
use think\Paginator;
class CatchQuery extends Query
{
@ -161,4 +163,15 @@ class CatchQuery extends Query
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
}
}