From 48aa1ce2f73df05b970be7da61c3315e799e1fa2 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 21 Apr 2023 14:02:24 +0800 Subject: [PATCH] * fix bug. --- module/doc/model.php | 2 +- module/user/model.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/module/doc/model.php b/module/doc/model.php index 78a3f77074..1a1999f9bc 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2184,7 +2184,7 @@ class docModel extends model ->andWhere('t2.deleted')->eq(0) ->fetch('count'); - $my = $this->dao->select("count(*) as myDocs, SUM(views) as docViews, SUM(collects) as docCollects")->from(TABLE_DOC)->where('addedBy')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->andWhere('vision')->eq($this->config->vision)->andWhere('lib')->ne(0)->fetch(); + $my = $this->dao->select("count(*) as myDocs, SUM(views) as docViews, SUM(collects) as docCollects")->from(TABLE_DOC)->where('addedBy')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->andWhere('vision')->eq($this->config->vision)->andWhere('lib')->ne('')->fetch(); $statistic->myDocs = $my->myDocs; $statistic->myDoc = new stdclass(); $statistic->myDoc->docViews = $my->docViews; diff --git a/module/user/model.php b/module/user/model.php index 05cb02032d..1c80f50a72 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -2892,8 +2892,7 @@ class userModel extends model $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'); } - $allLibs = $this->loadModel('doc')->getLibs('all'); - $personalData['createdDocs'] = $this->dao->select($count)->from(TABLE_DOC)->where('addedBy')->eq($account)->andWhere('lib')->in(array_keys($allLibs))->andWhere('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}'")