12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace catchAdmin\report\controller;
- use catcher\base\CatchRequest as Request;
- use catcher\CatchResponse;
- use catcher\base\CatchController;
- use catchAdmin\report\model\Report as ReportModel;
- class Report extends CatchController
- {
- protected $reportModel;
-
- public function __construct(ReportModel $reportModel)
- {
- $this->reportModel = $reportModel;
- }
-
- /**
- * 首页数量数据
- * @param Request $request
- */
- public function homePageCountData(Request $request)
- {
- // 基站数据
- // $station_data = $this->reportModel->getStationCountData() ?: [];
- // 部门数据
- $department_data = $this->reportModel->getDepartmentCountData() ?: [];
- // 用户数据
- $user_data = $this->reportModel->getDeviceUserCountData() ?: [];
- $data = array_merge($department_data, $user_data);
- return CatchResponse::success($data);
- }
- /**
- * 基站增长趋势数据
- * @param Request $request
- */
- public function stationGrowthTrendData(Request $request)
- {
- $data = $this->reportModel->getStationGrowthTrendData() ?: [];
-
- return CatchResponse::success($data);
- }
- /**
- * 用户设备增长趋势数据
- * @param Request $request
- */
- public function deviceGrowthTrendData(Request $request)
- {
- $data = $this->reportModel->getDeviceGrowthTrendData() ?: [];
-
- return CatchResponse::success($data);
- }
- }
|