SystemController.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace backend\modules\admin\controllers;
  3. use backend\controllers\AdminController;
  4. use backend\modules\admin\services\SystemService;
  5. use Yii;
  6. /**
  7. * 系统任务管理
  8. * Namespace backend\modules\admin\controllers
  9. * @Author:lun
  10. * @Date:2024-09-18 17:59
  11. * @Copyright:copyright(c)2024 广东七件事集团
  12. */
  13. class SystemController extends AdminController
  14. {
  15. /**
  16. * 获取系统状态
  17. * @Author:lun
  18. * @Date:2024-09-18 17:59
  19. * @Copyright:copyright(c)2024 广东七件事集团
  20. * @return mixed|string|null
  21. */
  22. public function actionGetSystemInfo()
  23. {
  24. $request = Yii::$app->request;
  25. if ($request->isAjax && $request->isPost) {
  26. $data = SystemService::getSystemConfig();
  27. if ($data['status'] == 0) return $this->error($data['msg']);
  28. return $this->success('获取成功', $data['data']);
  29. }
  30. }
  31. public function actionGetWraparound()
  32. {
  33. return $this->success('获取成功', SystemService::getWraparound());
  34. }
  35. public function actionGetSaleTrend()
  36. {
  37. return $this->success('获取成功', SystemService::getSaleTrend());
  38. }
  39. public function actionGetSaleTrendMonth()
  40. {
  41. $type = Yii::$app->request->get('type', 'month');
  42. return $this->success('获取成功', SystemService::getSaleTrendByMonth($type));
  43. }
  44. }