获取显示数据内容
@param int $pageSize
@param int $page
@return array
@throws \Exception
322788
public function getData($pageSize, $page)
    {
        $limit = ($page - 1) * $pageSize;
        $offset = $pageSize;
        $sql = "{$this->sqlment} LIMIT {$limit}, {$offset}";

        return $this->db->findAllBySql($sql, $this->params);
    }
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());
    }
572690
public function page($size = null, $page = null)
    {
        if ($size === null) {
            $size = (int)$this->request->get('size', 10);
        }

        if ($page === null) {
            $page = (int)$this->request->get('page', 1);
        }

        $this->limit($size, ($page - 1) * $size);

        return $this;
    }
909851
public function update(PageRequest $request, Page $page)
    {
        try {
            $data = $request->all();

            $page->update($data);
            $message = trans('messages.success.updated', ['Module' => trans('page::page.name')]);
            $code    = 204;
            $status  = 'success';
            $url     = guard_url('page/page/' . $page->getRouteKey());
        } catch (Exception $e) {
            $message = $e->getMessage();
            $code    = 400;
            $status  = 'error';
            $url     = guard_url('page/page/' . $page->getRouteKey());
        }
        return compact('data', 'message', 'code', 'status', 'url');
    }
417614
public function getMultilingualSectionForPage(Page $page)
    {
        $result = null;
        $siteTree = $page->getSiteTreeObject();
        if ($siteTree !== null) {
            $homeID = $siteTree->getSiteHomePageID();
            if ($homeID) {
                $mlSections = $this->getMultilingualSections();
                if (isset($mlSections[$homeID])) {
                    $result = $mlSections[$homeID];
                }
            }
        }

        return $result;
    }
837968
public function get($page, $pageSize, $websiteId = null, $storeId = null)
    {
        $this
            ->initCollection()
            ->filterMixedParam($websiteId, 'website_id')
            ->filterMixedParam($storeId, 'store_id')
            ->joinAddress('billing')
            ->joinAddress('shipping')
            ->joinSubscriptionStatus()
            ->setPage($page, $pageSize);

        return $this->customersResponseFactory->create()
            ->setCurrentPage($this->customerCollection->getCurPage())
            ->setLastPage($this->customerCollection->getLastPageNumber())
            ->setPageSize($this->customerCollection->getPageSize())
            ->setTotalCount($this->customerCollection->getSize())
            ->setCustomers($this->handleCustomers());
    }
165627
public function getTemplate(Page $page)
    {
        $this->authorize('editTemplate', $page);

        return view("$this->viewPrefix.template", [
            'current'   => $page->getTemplate(),
            'templates' => TemplateFacade::findValid(),
        ]);
    }
6662
public static function multiPage(int $page ,array $C , int $pagesize = 10 ):array
    {
        if(!self::is_indexArray($C)){
            throw new \Exception('Tools multiPage throw : $C must is indexed array!');
        }
        //区间数组
        $scopeC = array();
        //区间指针记录
        $scopePointInteger = 0;
        //记录在数轴上个区间位置
        foreach($C as $k => $v){
            $scopeC[$k] = array($scopePointInteger ,$scopePointInteger + $v);
            $scopePointInteger += intval($v);
        }

//        if($scopePointInteger <= 0 ){
//            throw new \Exception('Tools multiPage throw : sum value of array $C must be greater than 0!');
//        }

        $count = $scopePointInteger;
        //print_r($scopeC);
        //最大页数
        $maxPage = ceil($count / $pagesize);
        //实际分页数据区间
        $OriginScopeL = ($page - 1) * $pagesize;
        $OriginScopeR = $OriginScopeL + $pagesize;

        //初始化limit 数组 , 使其下标同 $C一致
        $ScopeLimit = array();
        for($i=0;$i < count($C);$i++){
            $ScopeLimit[$i] = false;
        }
        foreach ($scopeC as $key => $value) {
            if($value[1] <= $OriginScopeL){
                //不取 0 ~ 起始点的数据
                //$ScopeLimit[$key] = false;
            }else{
                //起始点以后的数据
                //获取起始点位置 , 起始点大于阶段的起始点的时候需要借位 ， 反之等于当前区间的第一位 针对limit 等于 0 , ?
                $start = $value[0] > $OriginScopeL ? 0 : $OriginScopeL - $value[0];
                //该区间的结束点 针对Limit
                $maxEnd = $C[$key] - $start;
                //获取结束点 位置 , 看结束点是否大于区间结束点
                if($OriginScopeR > $value[1]){
                    $end = $maxEnd;
                    $ScopeLimit[$key] = ' limit '.$start.','.$end;
                }else{
                    //反之 等于本区间结束点
                    //取差值
                    $Borrow = $value[1] - $OriginScopeR;
                    //取剩余数
                    $end = $maxEnd - $Borrow;
                    $ScopeLimit[$key] = ' limit '.$start.','.$end;
                    //echo $ScopeLimit[$key];
                    break;
                }
            }
        }

        return [
            'page' => $page,
            'pagesize' => $pagesize,
            'count' => $count,
            'maxpage' => $maxPage,
            'limit' => $ScopeLimit
        ];

    }
294803
public function pagesize($pagesize = null)
    {
        if ($pagesize === null) {
            return $this->options['pagesize'];
        } else {
            $this->options['pagesize'] = intval($pagesize);
            return $this;
        }
    }
436936
private function findChildrenPages(Page $page)
    {
        $pages = Page::where('parent_id', $page->id)->orderBy('header_order')->get();

        return $pages;
    }
978681
public function actionIndex($page = 1)
    {
        $sort = [];
        $params = Yii::$app->request->queryParams;
        if (empty($params['sort'])) {
            $sort['defaultOrder'] = ['parent_uid' => SORT_ASC, 'module_id' => SORT_ASC];
        } else {
            if($params['sort'] == 'module_id') {
                $sort['defaultOrder'] = ['parent_uid' => SORT_ASC, 'module_id' => SORT_ASC];
                unset($params['sort']);
            } else if ($params['sort'] == '-module_id') {
                $sort['defaultOrder'] = ['parent_uid' => SORT_DESC, 'module_id' => SORT_DESC];
                unset($params['sort']);
            }
            Yii::$app->request->setQueryParams($params);
        }

        $dataProvider = new ActiveDataProvider([
            'query' => Modmgr::find(),
            'sort' => $sort,
        ]);

        $pager = $dataProvider->getPagination();
        $pager->pageSize = $this->pageSize;
        $pager->page = $page - 1; //! from 0

        return $this->render('index', [
            'dataProvider' => $dataProvider,
        ]);
    }
844297
public function getList(
        $page = null,
        $pageSize = null,
        array $localeFilter = array(),
        array $countryCodeFilter = array(),
        array $additionalFields = array()
    ) {
        return $this->getInternalList(
            'region/list',
            'Region',
            array(
                'page' => (int)$page,
                'page_size' => (int)$pageSize,
                'locale_filter' => self::getArray($localeFilter),
                'country_code_filter' => self::getArray($countryCodeFilter),
                'fields' => self::getArray($additionalFields),
            )
        );
    }
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;
        };
    }
1069630
public function getSinglePageResourceUri( $pagenum = null, $pagesize=null)
    {
        if( is_null($pagenum) ) $pagenum  =$this->pagenum;
        if( is_null($pagesize)) $pagesize =$this->pagesize;
        
        //rebuild query string from already parsed _GET superglobal but do not override it.
        $vars = $_GET;
        $o=$this->ns(self::LOCAL);
        $vars[$o->getValue('plabel')]   = $pagenum;
        $vars[$o->getValue('pslabel')]  = $pagesize;
        
        return $this->getQueryStrippedUri() . '?'. http_build_query($vars);
    }
1287351
public function page($page)
    {
        //set the page
        $this->layout->page = $page;

        //set the layout content and title
        $this->layout->content = view($page);

        return $this->layout;
    }
1253377
public static function pageGetArray(?string $page = null): array
    {
        if ($page === null) {
            $page = $_SERVER['PHP_SELF'];
        }
        return self::getArray($page);
    }
496791
public function paginate($size = null, $page = null)
    {
        $this->page($size, $page);

        $items = $this->fetch(true);

        if ($this->_limit === null) {
            $count = count($items);
        } elseif (count($items) % $this->_limit === 0) {
            $count = $this->count();
        } else {
            $count = $this->_offset + count($items);
        }

        $paginator = $this->paginator;

        $paginator->items = $items;

        return $paginator->paginate($count, $this->_limit, (int)($this->_offset / $this->_limit) + 1);
    }