Show.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\admin\controller\customcharts;
  3. use app\common\controller\Backend;
  4. use think\Config;
  5. use think\Db;
  6. use addons\customcharts\library\Core as Customcharts;
  7. /**
  8. * 显示统计结果
  9. *
  10. * @icon fa fa-circle-o
  11. */
  12. class Show extends Backend
  13. {
  14. public function index()
  15. {
  16. if ($this->request->isPost()) {
  17. //选择时间重新查询图表统计
  18. $date = $this->request->post('date', '');
  19. $totalChart = Customcharts::totalChart($date);
  20. $this->success('', '', $totalChart);
  21. }
  22. //数量统计
  23. $totalNumber = Customcharts::totalNumber();
  24. $this->view->assign("totalNumber", $totalNumber);
  25. //图表统计
  26. $totalChart = Customcharts::totalChart();
  27. $this->view->assign("totalChart", $totalChart);
  28. $this->assignconfig('totalChart', $totalChart);
  29. //排行统计
  30. $totalRanking = Customcharts::totalRanking();
  31. $this->view->assign("totalRanking", $totalRanking);
  32. return $this->view->fetch();
  33. }
  34. }