page show
2016-03-10 10:49
232 查看
controller
view
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>
相关文章推荐
- Java的generics跟C++的template有何区别?
- Java的string类常量池及不可变性
- Redis学习-配置认证密码
- 如何使用Android Studio开发/调试Android源码
- Loader加载内容提供者的数据
- Tomcat下使用Log4j 接管 catalina.out 日志文件生成方式
- 对于改变随机数范围大小出现频率的操作
- window插字符的使用
- netstat命令
- 2016-03-10 自己的block1
- Java中ArrayList和LinkedList区别
- Exchange Server 2016 独立部署/共存部署 (四)—— 配置DAG(上)
- 全面剖析CSS Position定位
- @RequestBody, @ResponseBody 注解详解
- hdu1083(二分图,匈牙利模板题)
- Tomcat6标准日志,按天输出日志,并禁止catalina.out文件[tomcat中catalina.out日志时间久变得很大]
- UHF epc控制字计算
- tomcat原理
- javaScript中的小技巧
- PHP浮点数的一个常见问题