From e2ce3f7524d68ae513d55e6d78cdf7fbf204ccbb Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 27 Apr 2023 09:53:47 +0800 Subject: [PATCH] * fix bug. --- module/doc/model.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/module/doc/model.php b/module/doc/model.php index b580624266..4818a04613 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2179,7 +2179,11 @@ class docModel extends model { $today = date('Y-m-d'); $statistic = new stdclass(); - $statistic->totalDocs = $this->dao->select('count(*) as count')->from(TABLE_DOC)->where('deleted')->eq('0')->andWhere('type')->in('text,word,ppt,excel,url,article')->andWhere('vision')->eq($this->config->vision)->fetch('count'); + $statistic->totalDocs = $this->dao->select('count(*) as count')->from(TABLE_DOC) + ->where('deleted')->eq('0') + ->andWhere('type')->in('text,word,ppt,excel,url,article') + ->andWhere('vision')->eq($this->config->vision) + ->fetch('count'); $statistic->todayEditedDocs = $this->dao->select('count(DISTINCT objectID) as count')->from(TABLE_ACTION)->alias('t1') ->leftJoin(TABLE_DOC)->alias('t2')->on("t1.objectID=t2.id and t1.objectType='doc'") ->where('t1.objectType')->eq('doc') @@ -2188,6 +2192,7 @@ class docModel extends model ->andWhere('t1.vision')->eq($this->config->vision) ->andWhere('LEFT(t1.date, 10)')->eq($today) ->andWhere('t2.deleted')->eq(0) + ->andWhere('t2.type')->in('text,word,ppt,excel,url,article') ->fetch('count'); $statistic->myEditedDocs = $this->dao->select('count(DISTINCT t1.objectID) as count')->from(TABLE_ACTION)->alias('t1') ->leftJoin(TABLE_DOC)->alias('t2')->on("t1.objectID=t2.id and t1.objectType='doc'") @@ -2197,9 +2202,16 @@ class docModel extends model ->andWhere('t1.vision')->eq($this->config->vision) ->andWhere('t2.lib')->ne('') ->andWhere('t2.deleted')->eq(0) + ->andWhere('t2.type')->in('text,word,ppt,excel,url,article') ->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('type')->in('text,word,ppt,excel,url,article')->andWhere('deleted')->eq(0)->andWhere('vision')->eq($this->config->vision)->andWhere('lib')->ne('')->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('type')->in('text,word,ppt,excel,url,article') + ->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;