| 12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace hd\controllers;
- use bizHd\stat\classes\StatWorkCatItemClass;
- use common\components\dateUtil;
- use Yii;
- use common\components\util;
- class StatWorkCatItemController extends BaseController
- {
- //制作单花材明细统计 ssh 20220616
- public function actionItemList()
- {
- $get = Yii::$app->request->get();
- $where = [];
- $where['mainId'] = $this->mainId;
- $where['catId'] = $get['catId'] ?? 0;
- $searchTime = $get['searchTime'] ?? 'today';
- if (!empty($searchTime)) {
- $startTime = $get['startTime'] ?? '';
- $endTime = $get['endTime'] ?? '';
- $period = dateUtil::formatTime($searchTime, $startTime, $endTime, true);
- $where['time'] = ['between', [$period['startTime'], $period['endTime']]];
- }
- $data = StatWorkCatItemClass::getList('*', $where,'num DESC');
- util::success($data);
- }
- }
|