Report.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace catchAdmin\report\controller;
  3. use catcher\base\CatchRequest as Request;
  4. use catcher\CatchResponse;
  5. use catcher\base\CatchController;
  6. use catchAdmin\report\model\Report as ReportModel;
  7. class Report extends CatchController
  8. {
  9. protected $reportModel;
  10. public function __construct(ReportModel $reportModel)
  11. {
  12. $this->reportModel = $reportModel;
  13. }
  14. /**
  15. * 首页数量数据
  16. * @param Request $request
  17. */
  18. public function homePageCountData(Request $request)
  19. {
  20. // 基站数据
  21. // $station_data = $this->reportModel->getStationCountData() ?: [];
  22. $station_data =[];
  23. // 部门数据
  24. // $department_data = $this->reportModel->getDepartmentCountData() ?: [];
  25. // 用户数据
  26. $user_data = $this->reportModel->getDeviceUserCountData() ?: [];
  27. $data = array_merge($station_data, $user_data);
  28. return CatchResponse::success($data);
  29. }
  30. /**
  31. * 基站增长趋势数据
  32. * @param Request $request
  33. */
  34. public function stationGrowthTrendData(Request $request)
  35. {
  36. $data = $this->reportModel->getStationGrowthTrendData() ?: [];
  37. return CatchResponse::success($data);
  38. }
  39. /**
  40. * 用户设备增长趋势数据
  41. * @param Request $request
  42. */
  43. public function deviceGrowthTrendData(Request $request)
  44. {
  45. $data = $this->reportModel->getDeviceGrowthTrendData() ?: [];
  46. return CatchResponse::success($data);
  47. }
  48. }