// 查询满足要求的总记录数 $count = M("back")->where($back_map)->count(); $pagecount = ceil($count/10); $firstrow = ($page-1)*10; $listrow = 10; $result = M('xxx')->where($back_map) ->order('createtime desc')->limit($firstrow.','.$listrow)->select(); if($result){ $data['page'] = $page; $data['recordcount'] = "$count"; $data['pagecount'] = "$pagecount"; $data['backlist'] = $result; $array['status'] = 0; $array['responseParameters'] = $data; $array['comment'] = '查询成功!'; }else{ $array['status'] = 1; $array['comment'] = '未查到数据!'; }