曾超新 5 years ago
parent c73a8f9408
commit d62311016b
  1. 14
      frontend/controllers/StatisticsController.php
  2. 5
      frontend/views/statistics/work-info.php

@ -506,9 +506,19 @@ class StatisticsController extends BaseController
public function actionWorkInfo() { public function actionWorkInfo() {
$request = Yii::$app->request; $request = Yii::$app->request;
$user_id = $request->get('user_id'); $user_id = $request->get('user_id');
$date_begin = $request->get('date_begin');
$date_end = $request->get('date_end');
$date2_begin = $request->get('date2_begin');
$date2_end = $request->get('date2_end');
$username = $request->get('username');
return $this->render('work-info',[ return $this->render('work-info',[
'user_id' => $user_id 'user_id' => $user_id,
'date_begin' => $date_begin,
'date_end' => $date_end,
'date2_begin' => $date2_begin,
'date2_end' => $date2_end,
'username' => $username
]); ]);
} }
public function actionWorkInfoJson() public function actionWorkInfoJson()
@ -551,7 +561,7 @@ class StatisticsController extends BaseController
if($date2_end != '') { if($date2_end != '') {
$tmp_query = $tmp_query->andWhere('print_date<="'.$date2_end.'"'); $tmp_query = $tmp_query->andWhere('print_date<="'.$date2_end.'"');
} }
echo $tmp_query->createCommand()->rawSql."<br>"; // echo $tmp_query->createCommand()->rawSql."<br>";
$items = $tmp_query->all(); $items = $tmp_query->all();
foreach($items as $item) { foreach($items as $item) {
$total[0]++; $total[0]++;

@ -65,6 +65,11 @@ use \common\libs\MyLib;
sidePagination: 'server', sidePagination: 'server',
queryParams: function(params) { queryParams: function(params) {
o['user_id'] = '<?=$user_id?>'; o['user_id'] = '<?=$user_id?>';
o['date_begin'] = '<?=$date_begin?>';
o['date_end'] = '<?=$date_end?>';
o['date2_begin'] = '<?=$date2_begin?>';
o['date2_end'] = '<?=$date2_end?>';
o['username'] = '<?=$username?>';
o['offset'] = params['offset']; o['offset'] = params['offset'];
o['limit'] = params['limit']; o['limit'] = params['limit'];
return o; return o;

Loading…
Cancel
Save