ReserveDataController.php 859 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace addons\Store\client\controllers;
  3. use addons\ReservationService\common\services\BackendService;
  4. use addons\Store\common\services\StaffService;
  5. class ReserveDataController extends BaseController
  6. {
  7. /**
  8. * 数据概况
  9. * @return mixed|null
  10. */
  11. public function actionIndex()
  12. {
  13. if (\Yii::$app->request->isAjax && \Yii::$app->request->isGet) {
  14. $service = new StaffService(['store_id' => $this->store_id, 'mall_id' => $this->mall_id]);
  15. $ret['statistics'] = $service->statistics();
  16. $ret['order_rank'] = $service->orderRank();
  17. $ret['rating_rank'] = $service->ratingRand();
  18. $ret['custom_text'] = BackendService::getCustomText($this->mall_id);
  19. return $this->success('获取成功', $ret);
  20. }
  21. return $this->render('index');
  22. }
  23. }