分页.
如果$pageNo等于null，那么直接读取page[page]做为$pageNo和page[size]做为$size.

@param int|null $pageNo 页数,从1开始.
@param int      $size   默认每页20条

@return $this
@see QueryBuilder::limit()
11577
public function page($pageNo = null, $size = 20) {
        if ($pageNo === null) {
            $pageNo = irqst('pager.page', 1);
            $size   = irqst('pager.size', 20);
        }
        $pageNo = intval($pageNo);
        if ($pageNo <= 0) {
            $pageNo = 1;
        }

        return $this->limit(($pageNo - 1) * $size, $size);
    }
939443
public function withPaging($page = null, $limit = null)
    {
        $getPage = $this->input->get('page');
        $getLimit = $this->input->get('limit');

        $page = empty($page) ? (empty($getPage) ? 1 : $getPage) : $page;
        $limit = empty($limit) ? (empty($getLimit) ? 10 : $getLimit) : $limit;

        $this->qb->page($page, $limit);

        return $this;
    }
1247151
public function page($page)
    {
        $this->limit  = 0;
        $this->offset = 0;

        $page = (int)$page;
        if ($page > 0) {
            $this->limit  = $this->paging;
            $this->offset = $this->paging * ($page - 1);
        }
        return $this;
    }
759740
public static function page( int $page , int $count , int $pagesize = 10) :array
    {

//        if(empty($count)){
//            throw new \Exception('Tools page throw : count must is integer and greater than 0!');
//        }
        if( empty($page) || !is_numeric($page) ){
            $page = 1;
        }

        if( empty($pagesize) || !is_numeric($pagesize)){
            $pagesize = 10;
        }

        $maxpage = ceil($count / $pagesize);//获取最大页数

        $limit = [($page - 1) * $pagesize,$pagesize];

        return [
            'page' => $page,
            'pagesize' => $pagesize,
            'count' => $count,
            'maxpage' => $maxpage,
            'limit' => $limit
        ];
    }
1056314
public function paginate($count, $size = null, $page = null)
    {
        $this->count = (int)$count;
        $this->size = (int)($size ?: $this->request->get('size', 10));
        $this->page = (int)($page ?: $this->request->get('page', 1));
        $this->pages = (int)ceil($this->count / $this->size);
        $this->prev = ($this->page <= $this->pages && $this->page > 1) ? $this->page - 1 : -1;
        $this->next = $this->page < $this->pages ? $this->page + 1 : -1;

        return $this;
    }
1237558
public function paginate($limit, $useMaster = false, $page = null)
    {
        is_int($page) || $page = Input::requestInt(Config::get('var_page'), 1);
        $page < 1 && $page = 1;
        return call_user_func_array([$this, 'select'], [($page - 1) * $limit, $limit, $useMaster]);
    }
1055299
public function pageSize($pageSize = null)
    {
        if ($pageSize === null) {
            return $this->_pageSize;
        }
        $this->_pageSize = $pageSize;

        return $this;
    }
1039919
public function limit($size) {
        LimitImpl::limit($this->context, $size);
        return new ExecRule($this->context);
    }
767619
public function blockLimit($number = null)
    {
        $number = $number !== null ? intval($number) : $number;
        $this->_blockLimit = $number;

        return $this;
    }
1306500
public function get(
        $page = 1,
        $pageSize = 1000,
        $subscribed = null,
        $onlyGuest = false,
        $websiteId = null,
        $storeId = null
    ) {

        $this
            ->initCollection()
            ->joinWebsite()
            ->filterWebsite($websiteId)
            ->filterStore($storeId)
            ->filterSubscribed($subscribed)
            ->filterCustomers($onlyGuest)
            ->setPage($page, $pageSize);

        return $this->subscriptionsResponseFactory->create()
            ->setCurrentPage($this->subscriptionCollection->getCurPage())
            ->setLastPage($this->subscriptionCollection->getLastPageNumber())
            ->setPageSize($this->subscriptionCollection->getPageSize())
            ->setTotalCount($this->subscriptionCollection->getSize())
            ->setSubscriptions($this->handleSubscriptions());
    }
1279454
public function limit($page, $length)
    {
        //argument test
        Argument::i()
            //Argument 1 must be a number
            ->test(1, 'numeric')
            //Argument 2 must be a number
            ->test(2, 'numeric');
        
        $this->page = $page;
        $this->length = $length;

        return $this;
    }
446380
public static function get($page, $totalCount, $pageSize = 30)
    {
        $page = self::getPage($page);
        $pageCount = self::getPageCount($totalCount, $pageSize);
        $next = self::getNext($page, $pageCount);
        $pre = self::getPre($page);
        $limit = self::getLimit($pageSize);
        $offset = self::getOffset($page, $pageSize);
        return [
            'page' => $page,//当前页数
            'pageSize' => $pageSize,//分页大小
            'totalCount' => $totalCount,//总数
            'pageCount' => $pageCount,//总页数
            'next' => $next,//下一页
            'pre' => $pre,//上一页
            'limit' => $limit,//limit
            'offset' => $offset,//offset
        ];
    }
1075907
public static int getPageCount(int size, int pageSize, int page) {
        int totalPage = size / pageSize;
        if (size > pageSize * totalPage) {
            totalPage += 1;
        }
        return totalPage;
    }
449622
public function get(int $page, int $limit = 10): \Illuminate\Pagination\LengthAwarePaginator
    {
        if (!$this->_columns && !$this->_query) {
            return null;
        }
        $countTotal = $this->_query->count();
        $this->_query->skip(($limit * $page) - $limit);
        $this->_query->limit($limit);
        $data = collect();
        foreach ($this->_query->get() as $key => $instance) {
            if ($instance instanceof \Illuminate\Database\Eloquent\Model) {
                $_listRow = [];
                foreach ($this->_columns->getColumns() as $column) {
                    $_listRow[$column->getKey()] = $column->getValues($instance);
                }
                $buttons = $this->_columns->filterActions($instance);
                if (count($buttons)) {
                    $_listRow = array_merge($_listRow, [Column::ACTION_NAME => implode('', $buttons)]);
                }
                $data->offsetSet($key, $_listRow);
            }
        }
        $this->_data = new \Illuminate\Pagination\LengthAwarePaginator($data, $countTotal, $limit, $page, [
            'path'     => \Illuminate\Pagination\Paginator::resolveCurrentPath(),
            'pageName' => 'page',
        ]);

        return $this->_data;
    }
625441
public function setPageSize($size)
    {
        $this->pageSize = ($size === null ? self::PAGE_SIZE : (int)$size);
        if ($this->pageSize < 0)
            $this->pageSize = self::PAGE_SIZE;

        return $this;
    }
651877
private function createLinkClosure(int $pageSize): Closure
    {
        assert($pageSize > 0);

        parse_str($this->getOriginalUri()->getQuery(), $queryParams);

        return function ($offset) use ($pageSize, $queryParams) {
            $paramsWithPaging = array_merge($queryParams, [
                BaseQueryParserInterface::PARAM_PAGE => [
                    JsonApiQueryParserInterface::PARAM_PAGING_OFFSET => $offset,
                    JsonApiQueryParserInterface::PARAM_PAGING_LIMIT  => $pageSize,
                ],
            ]);
            $newUri  = $this->getOriginalUri()->withQuery(http_build_query($paramsWithPaging));
            $fullUrl = (string)$newUri;
            $link    = $this->getFactory()->createLink(false, $fullUrl, false);

            return $link;
        };
    }
649116
public function limit($start, $size) {
        LimitImpl::limitWithOffset($this->context, $start, $size);
        return new ForUpdateRule($this->context);
    }