From f620a37dd46c18abac93ccd9c794d2f33f82d18b Mon Sep 17 00:00:00 2001 From: liugang Date: Mon, 11 Dec 2023 14:55:51 +0800 Subject: [PATCH] * userModel: remove the unused getPersonalData method. --- module/user/control.php | 11 +++++------ module/user/model.php | 42 ----------------------------------------- 2 files changed, 5 insertions(+), 48 deletions(-) diff --git a/module/user/control.php b/module/user/control.php index d2e56c6a71..f390ee90ef 100755 --- a/module/user/control.php +++ b/module/user/control.php @@ -443,12 +443,11 @@ class user extends control $users = $this->loadModel('dept')->getDeptUserPairs($deptID, 'id'); if(!isset($users[$userID])) $users[$userID] = $user->realname; - $this->view->title = "USER #$user->id $user->account/" . $this->lang->user->profile; - $this->view->groups = $this->loadModel('group')->getByAccount($user->account); - $this->view->deptPath = $this->loadModel('dept')->getParents($user->dept); - $this->view->personalData = $this->user->getPersonalData($user->account); - $this->view->deptUsers = $users; - $this->view->user = $user; + $this->view->title = "USER #$user->id $user->account/" . $this->lang->user->profile; + $this->view->groups = $this->loadModel('group')->getByAccount($user->account); + $this->view->deptPath = $this->loadModel('dept')->getParents($user->dept); + $this->view->deptUsers = $users; + $this->view->user = $user; $this->display(); } diff --git a/module/user/model.php b/module/user/model.php index b1ba1c2db6..8c21f17775 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -2749,48 +2749,6 @@ class userModel extends model ->fetchAll(); } - /** - * Get personal data. - * - * @param string $account - * @access public - * @return array - */ - public function getPersonalData($account = '') - { - if(empty($account)) $account = $this->app->user->account; - $count = 'count(id) AS count'; - $t1Count = 'count(t1.id) AS count'; - - $personalData = array(); - $personalData['createdTodos'] = $this->dao->select($count)->from(TABLE_TODO)->where('account')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); - $personalData['createdRequirements'] = $this->dao->select($t1Count)->from(TABLE_STORY)->alias('t1')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')->where('t1.openedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->andWhere('t1.type')->eq('requirement')->fetch('count'); - $personalData['createdStories'] = $this->dao->select($t1Count)->from(TABLE_STORY)->alias('t1')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')->where('t1.openedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->andWhere('t1.type')->eq('story')->fetch('count'); - $personalData['createdBugs'] = $this->dao->select($t1Count)->from(TABLE_BUG)->alias('t1')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')->where('t1.openedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count'); - $personalData['resolvedBugs'] = $this->dao->select($t1Count)->from(TABLE_BUG)->alias('t1')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')->where('t1.resolvedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count'); - $personalData['createdCases'] = $this->dao->select($count)->from(TABLE_CASE)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); - - if(in_array($this->config->edition, array('max', 'ipd'))) - { - $personalData['createdRisks'] = $this->dao->select($t1Count)->from(TABLE_RISK)->alias('t1')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->where('t1.createdBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count'); - $personalData['resolvedRisks'] = $this->dao->select($t1Count)->from(TABLE_RISK)->alias('t1')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->where('t1.resolvedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count'); - $personalData['createdIssues'] = $this->dao->select($t1Count)->from(TABLE_ISSUE)->alias('t1')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->where('t1.createdBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count'); - $personalData['resolvedIssues'] = $this->dao->select($t1Count)->from(TABLE_ISSUE)->alias('t1')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->where('t1.resolvedBy')->eq($account)->andWhere('t1.deleted')->eq('0')->andWhere('t2.deleted')->eq('0')->fetch('count'); - } - $personalData['createdDocs'] = $this->dao->select($count)->from(TABLE_DOC)->where('addedBy')->eq($account)->andWhere('lib')->ne('')->andWhere('deleted')->eq('0')->andWhere('vision')->eq($this->config->vision)->fetch('count'); - $personalData['finishedTasks'] = $this->dao->select($t1Count)->from(TABLE_TASK)->alias('t1') - ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') - ->leftJoin(TABLE_TASKTEAM)->alias('t3')->on("t1.id = t3.task and t3.account = '{$account}'") - ->where('t1.deleted')->eq('0') - ->andWhere('t2.deleted')->eq('0') - ->andWhere('t1.finishedBy', true)->eq($account) - ->orWhere('t3.status')->eq("done") - ->markRight(1) - ->fetch('count'); - - return $personalData; - } - /** * 为 GitLab API 获取用户列表。 * Get user list for GitLab API.