Echarts.php 814 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace app\admin\controller\example;
  3. use app\common\controller\Backend;
  4. /**
  5. * 统计图表示例
  6. *
  7. * @icon fa fa-charts
  8. * @remark 展示在FastAdmin中使用Echarts展示丰富多彩的统计图表
  9. */
  10. class Echarts extends Backend
  11. {
  12. protected $model = null;
  13. public function _initialize()
  14. {
  15. parent::_initialize();
  16. $this->model = model('AdminLog');
  17. }
  18. /**
  19. * 查看
  20. */
  21. public function index()
  22. {
  23. return $this->view->fetch();
  24. }
  25. /**
  26. * 详情
  27. */
  28. public function detail($ids)
  29. {
  30. $row = $this->model->get(['id' => $ids]);
  31. if (!$row) {
  32. $this->error(__('No Results were found'));
  33. }
  34. $this->view->assign("row", $row->toArray());
  35. return $this->view->fetch();
  36. }
  37. }