|
public function getLabelData(){ //生成josn
$pageNum = I('pageNum');
$totalItem = M('label')->count();
$pageSize = 6;
$totalPage = ceil($totalItem/$pageSize);
$startItem = ($pageNum-1) * $pageSize;
$arr['totalItem'] = $totalItem;
$arr['pageSize'] = $pageSize;
$arr['totalPage'] = $totalPage;
$labels = M('label')->limit($startItem,$pageSize)->select();
foreach($labels as $lab) {
$arr['data_content'][] = $lab;
}
echo json_encode($arr);
} |
|