thinkphp 3.2中分页源码在哪
展开全部
我贴一段代码吧,你应该能看懂
public function TradingList($p = null) {
$p = intval($p) ? intval($p) : 1;
$pageSize = 15;
$offset = ($p - 1) * $pageSize;
$db = M('rebate_trading');
$TradingList = $db->where(array('userid' => XAAKE))->order('time')->limit($offset, $pageSize)->select();
$count = count($db->where(array('userid' => XAAKE))->select());
$page = new \Think\Page($count, $pageSize);
$page = $page->show();
$this->assign('page', $page);
$this->assign('TradingList', $TradingList);
$this->pagetitle = '已买入订单';
$this->display();
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询