src/Leevel/Database/Select.php
public function page(int $currentPage, int $perPage = 10, bool $flag = false, bool $withTotal = true, string $column = '*'): array
    {
        $from = ($currentPage - 1) * $perPage;

        return [
            [
                'per_page'     => $perPage,
                'current_page' => $currentPage,
                'total_record' => $withTotal ? $this->pageCount($column) : null,
                'from'         => $from,
            ],
            $this
                ->limit($from, $perPage)
                ->findAll($flag),
            self::PAGE => true,
        ];
    }
public function page(int $currentPage, int $perPage = 10, bool $flag = false, bool $withTotal = true, string $column = '*'): array
    {
        $from = ($currentPage - 1) * $perPage;

        return [
            [
                'per_page'     => $perPage,
                'current_page' => $currentPage,
                'total_record' => $withTotal ? $this->pageCount($column) : null,
                'from'         => $from,
            ],
            $this
                ->limit($from, $perPage)
                ->findAll($flag),
            self::PAGE => true,
        ];
    }
分页查询.

@param int    $currentPage
@param int    $perPage
@param bool   $flag
@param bool   $withTotal
@param string $column

@return array