CommentModel.class.php 926 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * lionfish 商城系统
  4. *
  5. * ==========================================================================
  6. * @link http://www.liofis.com/
  7. * @copyright Copyright (c) 2015 liofis.com.
  8. * @license http://www.liofis.com/license.html License
  9. * ==========================================================================
  10. *
  11. * @author fish
  12. *
  13. */
  14. namespace Admin\Model;
  15. use Think\Model;
  16. class CommentModel extends Model{
  17. public function show_comment_page(){
  18. $sql='SELECT * FROM '.C('DB_PREFIX').'comment ';
  19. $count=count(M()->query($sql));
  20. $Page = new \Think\Page($count,C('BACK_PAGE_NUM'));
  21. $show = $Page->show();// 分页显示输出
  22. $sql.=' order by comment_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. ?>