field('user,operation,record,create_time')->order('id')->limit('50')->fetchAll(); $count = $test->field('count(1) as count')->fetch(); $data = [ 'Code'=>10000, 'count'=>$count['count'], 'data'=>$list ]; echo json_encode($data); } //获取指定页码数据 public function pageList() { if(!$_GET){ die; } $page = ($_GET['page'] - 1) * 50; $test = new Test(); $list = $test->limit("$page,50")->fetchAll(); $data = [ 'Code'=>10000, 'data'=>$list ]; echo json_encode($data); } }