控制器:
//金币扣除public function jbkc(){ $map['UG_dataType']= 'xtkc'; $list1 = M ( 'userget' )->where ( $map )->select (); $list2 = M ( 'userget2' )->where ( $map )->select (); $list3 = M ( 'userget3' )->where ( $map )->select (); $list0=array_merge($list1,$list2,$list3); $count=count($list0); $p = getpage($count,20); $list=array_slice($list0,$p->firstRow,$p->listRows); $this->assign ( 'list', $list ); $this->assign ( 'page', $p->show()); $this->display('index/jbkc'); }
公共函数:
function getpage($count, $pagesize = 10) { $p = new Think\Page($count, $pagesize); $p->setConfig('header', '