fix: [statistics] fixed an issue where the org statistics didn't correctly apply the local filters

- both local and external just showed the sum totals instead of the individual pools
pull/3582/head
iglocska 2018-08-21 13:34:59 +02:00
parent e1fc7b2e50
commit 12ac58f0e1
1 changed files with 2 additions and 2 deletions

View File

@ -1701,7 +1701,7 @@ class UsersController extends AppController
);
$scopes = array(
'user' => array(
'conditions' => null,
'conditions' => array(),
'model' => 'User',
'date_created' => 'timestamp'
),
@ -1726,7 +1726,7 @@ class UsersController extends AppController
if ($scope_data['date_created'] === 'datetime') {
$condition = date('Y-m-d H:i:s', $condition);
}
$params['conditions'] = array($scope_data['model'] . '.date_created >=' => $condition);
$params['conditions'] = array_merge($scopes[$scope]['conditions'], array($scope_data['model'] . '.date_created >=' => $condition));
}
$statistics[$scope]['data'][$range] = $this->{$scope_data['model']}->find('count', $params);
}