StatWorkCatItemController.php 922 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace hd\controllers;
  3. use bizHd\stat\classes\StatWorkCatItemClass;
  4. use common\components\dateUtil;
  5. use Yii;
  6. use common\components\util;
  7. class StatWorkCatItemController extends BaseController
  8. {
  9. //制作单花材明细统计 ssh 20220616
  10. public function actionItemList()
  11. {
  12. $get = Yii::$app->request->get();
  13. $where = [];
  14. $where['mainId'] = $this->mainId;
  15. $where['catId'] = $get['catId'] ?? 0;
  16. $searchTime = $get['searchTime'] ?? 'today';
  17. if (!empty($searchTime)) {
  18. $startTime = $get['startTime'] ?? '';
  19. $endTime = $get['endTime'] ?? '';
  20. $period = dateUtil::formatTime($searchTime, $startTime, $endTime, true);
  21. $where['time'] = ['between', [$period['startTime'], $period['endTime']]];
  22. }
  23. $data = StatWorkCatItemClass::getList('*', $where,'num DESC');
  24. util::success($data);
  25. }
  26. }