StatKdController.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace ghs\controllers;
  3. use biz\stat\classes\StatKdClass;
  4. use biz\stat\classes\StatRefundClass;
  5. use common\components\dateUtil;
  6. use Yii;
  7. use common\components\util;
  8. class StatKdController extends BaseController
  9. {
  10. //开单收入统计 shish 20211017
  11. public function actionProfile()
  12. {
  13. $get = Yii::$app->request->get();
  14. $where = [];
  15. $where['shopId'] = $this->shopId;
  16. if (isset($get['shopId']) && !empty($get['shopId'])) {
  17. $where['shopId'] = $get['shopId'];
  18. }
  19. $selectTime = $get['selectTime'] ?? 'thisMonth';
  20. if (!empty($selectTime)) {
  21. $startTime = $get['startTime'] ?? '';
  22. $endTime = $get['endTime'] ?? '';
  23. $period = dateUtil::formatTime($selectTime, $startTime, $endTime, true);
  24. $where['time'] = ['between', [$period['startTime'], $period['endTime']]];
  25. }
  26. $kdList = StatKdClass::getAllByCondition($where, null, '*');
  27. $refundList = StatRefundClass::getAllByCondition($where, null, '*');
  28. }
  29. }