function get($table = '', $limit = null, $offset = null)
{
if ($table != '') {
$this->_track_aliases($table);
$this->from($table);
}
if (!is_null($limit)) {
$this->limit($limit, $offset);
}
$sql = $this->_compile_select();
$result = $this->query($sql);
$this->_reset_select();
return $result;
}
/** * 批量读取数据 * @param array|string $where 条件 * @param string $order 排序字段 * @param int $limit 查询数量 * @param int $offset 查询起始偏移量 * @return array */ public function fetchAll($cols = '*', $where, $order, $limit = NULL, $offset = NULL) { $this->db->select($cols); $this->where($where); if (!empty($order)) { $this->db->order_by($order); } return $this->db->get($this->_name, $limit, $offset)->result_array(); }