core/PageList.php
public function getInfo()
    {
        if ($this->info != null) {
            return $this->info;
        }
        if ($this->recordsCount == -1) {
            if ($this->selector) {
                $this->recordsCount = $this->selector->getCount();
            } else {
                if (strripos($this->sql, ' from ') === stripos($this->sql, ' from ')) {
                    $sql = preg_replace('@^select\s+(distinct\s+[a-z][a-z0-9]+\s*,)?(.*)\s+from\s+@', 'select $1count(1) from ', $this->sql);
                    $row = DB::getRow($sql, $this->args, PDO::FETCH_NUM);
                } else {
                    $row = DB::getRow('select count(1) from (' . $this->sql . ') MyTempTable', $this->args, PDO::FETCH_NUM);
                }
                $this->recordsCount = $row[0];
            }
        }
        if ($this->onlyCount == -1 || $this->onlyCount > $this->recordsCount) {
            $this->onlyCount = $this->recordsCount;
        }
        if ($this->pageCount == -1) {
            $this->pageCount = $this->getPageCount($this->onlyCount, $this->pageSize);
        }
        if ($this->page <= 0) {
            $this->page = 1;
        }
        if ($this->page > $this->pageCount) {
            $this->page = $this->pageCount;
        }
        $this->info = array(
            'keyName' => $this->key,
            'page' => $this->page,
            'pageCount' => $this->pageCount,
            'recordsCount' => $this->recordsCount,
            'onlyCount' => $this->onlyCount,
            'pageSize' => $this->pageSize,
        );
        return $this->info;
    }
public function getInfo()
    {
        if ($this->info != null) {
            return $this->info;
        }
        if ($this->recordsCount == -1) {
            if ($this->selector) {
                $this->recordsCount = $this->selector->getCount();
            } else {
                if (strripos($this->sql, ' from ') === stripos($this->sql, ' from ')) {
                    $sql = preg_replace('@^select\s+(distinct\s+[a-z][a-z0-9]+\s*,)?(.*)\s+from\s+@', 'select $1count(1) from ', $this->sql);
                    $row = DB::getRow($sql, $this->args, PDO::FETCH_NUM);
                } else {
                    $row = DB::getRow('select count(1) from (' . $this->sql . ') MyTempTable', $this->args, PDO::FETCH_NUM);
                }
                $this->recordsCount = $row[0];
            }
        }
        if ($this->onlyCount == -1 || $this->onlyCount > $this->recordsCount) {
            $this->onlyCount = $this->recordsCount;
        }
        if ($this->pageCount == -1) {
            $this->pageCount = $this->getPageCount($this->onlyCount, $this->pageSize);
        }
        if ($this->page <= 0) {
            $this->page = 1;
        }
        if ($this->page > $this->pageCount) {
            $this->page = $this->pageCount;
        }
        $this->info = array(
            'keyName' => $this->key,
            'page' => $this->page,
            'pageCount' => $this->pageCount,
            'recordsCount' => $this->recordsCount,
            'onlyCount' => $this->onlyCount,
            'pageSize' => $this->pageSize,
        );
        return $this->info;
    }
获取 分页信息数据
array(<br/>
'page_key'      ：分页参数名称 如果 page,<br/>
'query'         ：本页所附带的连接 即 $_SERVER['REQUEST_URI'] <br/>例如 cid=3&keyword=abc&page=3<br/>
'other_query'   ：除了page 外的所有 附带参数, <br/>例如 cid=3&keyword=abc 不带页码参数<br/>
'page'          ：当前 页码,<br/>
'page_count'    ：页数，即最大页数,<br/>
'records_count' ：记录数,<br/>
'size'          ：分页尺度，即按多少条记录为一页,<br/>
)
@return array|null
@throws \Exception