查询分页数据信息时经常要查分页列表和数据总数,但总会报错
如:$query = Db::name('table_name')->where($where);
$total = $query->count();
$list = $query->select();
这样查询就会出现数据bug
再如把上面查询分开两个来查,$queryCount = clone $query;
$total = $queryCount->count();
就这样还是碰到bug
SQLSTATE[HY000]: General error: 2031