StatisticsController.class.php 724 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Admin\Controller;
  3. use Admin\Model\StatisticsModel;
  4. class StatisticsController extends CommonController {
  5. protected function _initialize(){
  6. parent::_initialize();
  7. $this->breadcrumb1='首页';
  8. $this->breadcrumb2='访客IP';
  9. }
  10. public function show_ip(){
  11. $model=new StatisticsModel();
  12. $type=I('type');
  13. if($type=='today'){
  14. $data=$model->show_visitors_ip(date('Y-m-d'));
  15. }elseif($type=='all'){
  16. $data=$model->show_visitors_ip();
  17. }
  18. $this->c=$data['count'];
  19. $this->assign('empty',$data['empty']);// 赋值数据集
  20. $this->assign('list',$data['list']);// 赋值数据集
  21. $this->assign('page',$data['page']);// 赋值分页输出
  22. $this->display('ip');
  23. }
  24. }