core/SqlSelector.php
public function pageLimit(int $page = 1, int $size = 20)
    {
        if ($page < 1) {
            $page = 1;
        }
        $offset = ($page - 1) * $size;
        if ($offset < 0) {
            $offset = 0;
        }
        $this->limit($offset, $size);
        return $this;
    }
public function pageLimit(int $page = 1, int $size = 20)
    {
        if ($page < 1) {
            $page = 1;
        }
        $offset = ($page - 1) * $size;
        if ($offset < 0) {
            $offset = 0;
        }
        $this->limit($offset, $size);
        return $this;
    }
按页码和分页尺寸进行分页
@param int $page
@param int $size
@return $this