StatYjController.php 823 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace ghs\controllers;
  3. use bizGhs\stat\classes\StatYjClass;
  4. use common\components\dateUtil;
  5. use Yii;
  6. use common\components\util;
  7. class StatYjController extends BaseController
  8. {
  9. //员工业绩 ssh 2021.3.15
  10. public function actionList()
  11. {
  12. $get = Yii::$app->request->get();
  13. $where = [];
  14. $where['shopId'] = $this->shopId;
  15. if (isset($get['shopId']) && !empty($get['shopId'])) {
  16. $where['shopId'] = $get['shopId'];
  17. }
  18. $selectTime = $get['selectTime'] ?? '';
  19. if (!empty($selectTime)) {
  20. $startTime = $get['startTime'] ?? '';
  21. $endTime = $get['endTime'] ?? '';
  22. $period = dateUtil::formatTime($selectTime, $startTime, $endTime, true);
  23. $where['time'] = ['between', [$period['startTime'], $period['endTime']]];
  24. }
  25. $respond = StatYjClass::getYjList($where);
  26. util::success($respond);
  27. }
  28. }