thinkphp 3.2中分页源码在哪
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();
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询