您的位置:首页 > 其它

page show

2016-03-10 10:49 232 查看
controller

public function record()
{
$r     = 10;
$m     = M();
$query = $m->query('select count(1) as count from winner');
$total = $query[0]['count'];
$page  = new \Think\Page($total,$r);// 实例化分页类 传入总记录数和每页显示的记录数(25)
$show  = $page->show();// 分页显示输出
$list  = $m->query("select w.id, w.uid, w.create_time, u.username, i.name from winner as w, user as u, item as i where u.id=w.uid and i.id=w.prize_id order by w.create_time limit $page->firstRow, $page->listRows");
$this->assign('list',$list);// 赋值数据集
$this->assign('page',$show);// 赋值分页输出
$this->display(T('Winner@Admin/record'));
}


view

<extend name="Public/base"/>

<block name="body">
<div class="main-title">
<h2>中奖纪录</h2>
</div>

<div class="with-padding">
<form id="export-form" method="post" action="{:U('export')}">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>序号</th>
<th>ID</th>
<th>用户名</th>
<th>奖品</th>
<th>时间</th>
</tr>
</thead>
<tbody>
<volist name="list" id="table">
<tr>
<td>{$i}</td>
<td>{$table.id}</td>
<td><a href='/xxx/index.php?s=/admin/user/expandinfo_details/uid/{$table.uid}.html'> {$table.username}</a></td>
<td>{$table.name}</td>
<td><?php echo date('Y-m-d H:i:s', $table['create_time']);?></td>
</tr>
</volist>
</tbody>
</table>
</form>
</div>
{$page}
</block>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: