BlogReplyModel.class.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * 小梦科技资源nanodreamtech.com
  4. *
  5. * ==========================================================================
  6. * @link https://www.nanodreamtech.com/
  7. * @copyright Copyright (c) 2015 liofis.com.
  8. * @license https://www.nanodreamtech.com/license.html License
  9. * ==========================================================================
  10. *
  11. * @author fish
  12. *
  13. */
  14. namespace Admin\Model;
  15. use Think\Model;
  16. class BlogReplyModel extends Model{
  17. public function show_blog_reply_page(){
  18. $sql='SELECT br.*,b.title as blog_title FROM '.C('DB_PREFIX').'blog_reply br,'.C('DB_PREFIX').'blog b where b.blog_id=br.blog_id';
  19. $count=count(M()->query($sql));
  20. $Page = new \Think\Page($count,C('BACK_PAGE_NUM'));
  21. $show = $Page->show();// 分页显示输出
  22. $sql.=' order by b.blog_id desc LIMIT '.$Page->firstRow.','.$Page->listRows;
  23. $list=M()->query($sql);
  24. return array(
  25. 'empty'=>'<tr><td colspan="20">~~暂无数据</td></tr>',
  26. 'list'=>$list,
  27. 'page'=>$show
  28. );
  29. }
  30. }
  31. ?>