| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace ghs\controllers;
- use bizGhs\stat\classes\StatYjClass;
- use common\components\dateUtil;
- use Yii;
- use common\components\util;
- class StatYjController extends BaseController
- {
- //员工业绩 ssh 20221115
- public function actionProfile()
- {
- ini_set('memory_limit', '2045M');
- set_time_limit(0);
- $mainId = $this->mainId;
- $respond = StatYjClass::profile($mainId);
- $income = $respond['income'] ?? 0;
- $expend = $respond['expend'] ?? 0;
- $balance = $respond['balance'] ?? 0;
- util::success(['income' => $income, 'expend' => $expend, 'balance' => floatval($balance)]);
- }
- //员工业绩 ssh 2021.3.15
- public function actionList()
- {
- $get = Yii::$app->request->get();
- $where = [];
- $where['mainId'] = $this->mainId;
- $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']]];
- }
- $respond = StatYjClass::getYjList($where);
- util::success($respond);
- }
- }
|