/**
* 改装的用于获取当前结果集的总数(不带分页的)
* 它不能兼容 group_by
* @return unknown
*/
function get_db_num(){
$sql = $this->CI->db->_compile_select($this->CI->db->_count_string . $this->CI->db->_protect_identifiers('numrows'));
$query = $this->CI->db->query($sql);
if ($query->num_rows() == 0)
{
return 0;
}
$row = $query->row();
return (int) $row->numrows;
}