src/DB/Drivers/PDOSqlDriver.php
public function find($table, $fields, $where, $order = 1, array &$page = array('p' => 1, 'limit' => 50), $group_by = 1)
    {
        if (!isset($page['result_count'])) {
            $total = $this->get($table, 'COUNT(*) as total', $where);
            $page['result_count'] = (int)$total['total'];
        }

        $page['limit'] = max(1, (int)$page['limit']);
        $page['total_page'] = ceil($page['result_count'] / $page['limit']);

        if ($page['p'] <= $page['total_page']) {
            $page['p'] = max(1, $page['p']);
            $this->SQLAssembler->find($table, $fields, $where, $order, $page, $group_by);
            return $this->getPrepareResult(true);
        }

        return array();
    }
public function find($table, $fields, $where, $order = 1, array &$page = array('p' => 1, 'limit' => 50), $group_by = 1)
    {
        if (!isset($page['result_count'])) {
            $total = $this->get($table, 'COUNT(*) as total', $where);
            $page['result_count'] = (int)$total['total'];
        }

        $page['limit'] = max(1, (int)$page['limit']);
        $page['total_page'] = ceil($page['result_count'] / $page['limit']);

        if ($page['p'] <= $page['total_page']) {
            $page['p'] = max(1, $page['p']);
            $this->SQLAssembler->find($table, $fields, $where, $order, $page, $group_by);
            return $this->getPrepareResult(true);
        }

        return array();
    }
带分页的数据查询

@param string $table
@param string $fields
@param string|array $where
@param string|int $order
@param array $page
@param int $group_by
@return mixed
@throws CoreException