StoreStatisticsController.php 906 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace addons\Store\backend\controllers;
  3. use addons\Store\common\services\StoreStatisticsService;
  4. /**
  5. * 资产统计
  6. */
  7. class StoreStatisticsController extends BaseController
  8. {
  9. /**
  10. * 资产统计
  11. *
  12. * @return string
  13. */
  14. public function actionIndex(): string
  15. {
  16. return $this->render('index');
  17. }
  18. /**
  19. * 收入明细
  20. *
  21. * @return mixed
  22. */
  23. public function actionIncomeLog()
  24. {
  25. if (!\Yii::$app->request->isAjax) {
  26. return $this->render($this->action->id);
  27. }
  28. $params = $this->request->get();
  29. if (empty($params['store_id'])) {
  30. return $this->error('门店参数不存在');
  31. }
  32. $service = new StoreStatisticsService($this->mall_id, $params['store_id']);
  33. return $this->success('success', $service->getIncomeLogList($params, $this->pageSize));
  34. }
  35. }