* Finish task #7734.

This commit is contained in:
holan20180123
2020-09-01 15:47:03 +08:00
parent 814bea0cd3
commit 20a09be88e
7 changed files with 69 additions and 69 deletions
+10 -5
View File
@@ -1853,13 +1853,18 @@ class userModel extends model
public function getPersonalData($account = '')
{
if(empty($account)) $account = $this->app->user->account;
$count = 'count(*) AS count';
$personalData = array();
$personalData['createdTodo'] = $this->dao->select('count(*) as count')->from(TABLE_TODO)->where('account')->eq($account)->fetch('count');
$personalData['createdStory'] = $this->dao->select('count(*) as count')->from(TABLE_STORY)->where('openedBy')->eq($account)->andWhere('type')->eq('story')->andWhere('deleted')->eq('0')->fetch('count');
$personalData['finishedTask'] = $this->dao->select('count(*) as count')->from(TABLE_TASK)->where('finishedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['resolvedBug'] = $this->dao->select('count(*) as count')->from(TABLE_BUG)->where('resolvedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['createdCase'] = $this->dao->select('count(*) as count')->from(TABLE_CASE)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['createdTodo'] = $this->dao->select($count)->from(TABLE_TODO)->where('account')->eq($account)->fetch('count');
$personalData['createdStory'] = $this->dao->select($count)->from(TABLE_STORY)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['resolvedBug'] = $this->dao->select($count)->from(TABLE_BUG)->where('resolvedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count');
$personalData['createdCase'] = $this->dao->select($count)->from(TABLE_CASE)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->andWhere('product')->ne(0)->fetch('count');
$personalData['finishedTask'] = $this->dao->select($count)->from(TABLE_TASK)->where('deleted')->eq('0')
->andWhere('finishedBy', true)->eq($account)
->orWhere('finishedList')->like("%,{$account},%")
->markRight(1)
->fetch('count');
return $personalData;
}