https://forum.codeigniter.com/archive/index.php?thread-64966.html
```
$this->db->select('SQL_CALC_FOUND_ROWS *', false);
//避免重复查询,如果限定字段却查出所有,将此处'*'换成id之类的
//此处正常带limit查询语句
// 获取总条数
$query = $this->db->query('SELECT FOUND_ROWS() AS `count`');
$totalRows = $query->row()->count;
```