StatYjController.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 20221115
  10. public function actionProfile()
  11. {
  12. ini_set('memory_limit', '2045M');
  13. set_time_limit(0);
  14. $mainId = $this->mainId;
  15. $profile = StatYjClass::profile($mainId);
  16. util::success(['list' => $profile]);
  17. }
  18. //员工业绩 ssh 2021.3.15
  19. public function actionList()
  20. {
  21. $get = Yii::$app->request->get();
  22. $where = [];
  23. $where['mainId'] = $this->mainId;
  24. $searchTime = $get['searchTime'] ?? 'today';
  25. if (!empty($searchTime)) {
  26. $startTime = $get['startTime'] ?? '';
  27. $endTime = $get['endTime'] ?? '';
  28. $period = dateUtil::formatTime($searchTime, $startTime, $endTime, true);
  29. $where['time'] = ['between', [$period['startTime'], $period['endTime']]];
  30. }
  31. $respond = StatYjClass::getYjList($where);
  32. util::success($respond);
  33. }
  34. }