StoreStatisticsController.php 918 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace addons\Happiness\backend\controllers;
  3. use addons\Happiness\common\service\StoreService;
  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. $info = (new StoreService(['mall_id' => $this->mall_id, 'store_id' => $params['store_id']]))->getIncomeLogList($params, $this->pageSize);
  33. return $this->success('success', $info);
  34. }
  35. }