This commit is contained in:
sunjun
2022-07-06 14:33:20 +00:00
parent 0842185bfc
commit de58643be7
2 changed files with 16 additions and 16 deletions
+1
View File
@@ -409,6 +409,7 @@ class deptModel extends model
->where('deleted')->eq(0)
->beginIF(strpos($params, 'all') === false)->andWhere('type')->eq($type)->fi()
->beginIF($childDepts)->andWhere('dept')->in($childDepts)->fi()
->beginIF($deptID === '0')->andWhere('dept')->eq($deptID)->fi()
->beginIF($this->config->vision)->andWhere("CONCAT(',', visions, ',')")->like("%,{$this->config->vision},%")->fi()
->orderBy('account')
->fetchPairs();
+15 -16
View File
@@ -315,6 +315,21 @@ class report extends control
$users[''] = $this->lang->report->annualData->allUser;
$depts = $this->loadModel('dept')->getOptionMenu();
$accounts = array();
if($userID)
{
$user = $this->loadModel('user')->getById($userID, 'id');
$dept = $user->dept;
$users = $this->loadModel('dept')->getDeptUserPairs($dept, 'id');
$accounts = array($user->account => ($user->realname ? $user->realname : $user->account));
}
else
{
$users = $this->loadModel('dept')->getDeptUserPairs($dept, 'id');
$users = array('' => $this->lang->report->annualData->allUser) + $users;
$accounts = $this->loadModel('dept')->getDeptUserPairs($dept);
}
a($this->app->user->account);
if(!$this->app->user->admin)
{
foreach($depts as $id => $name) if($id != $this->app->user->dept) unset($depts[$id]);
@@ -323,25 +338,9 @@ class report extends control
{
$depts = array('' => $this->lang->report->annualData->allDept) + $depts;
}
if(empty($userID)) unset($depts[0]);
$accounts = array();
if($dept) $accounts = $this->loadModel('dept')->getDeptUserPairs($dept);
if($userID)
{
$user = $this->loadModel('user')->getById($userID, 'id');
$dept = $user->dept;
$accounts = array($user->account => ($user->realname ? $user->realname : $user->account));
}
if(empty($accounts)) $accounts = $this->user->getPairs('noletter|noclosed');
if($accounts) $accounts = array_keys($accounts);
if($dept)
{
$users = $this->loadModel('dept')->getDeptUserPairs($dept, 'id');
$users = array('' => $this->lang->report->annualData->allUser) + $users;
}
/* Get annual data. */
$data = array();
if(!$userID)