From f37eea5af8ce4951c7779cb67145852fe35958f8 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 11 Apr 2023 09:43:24 +0800 Subject: [PATCH] * fix error. --- module/doc/control.php | 2 +- module/doc/model.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 3c8df8d00b..144d27282c 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -91,7 +91,7 @@ class doc extends control $docs = array(); if($type == 'mine') { - $docs = $this->doc->getDocs($libID, $moduleID, $browseType, $orderBy, $pager); + $docs = $libID ? $this->doc->getDocs($libID, $moduleID, $browseType, $orderBy, $pager) : array(); } elseif($type == 'view' or $type == 'collect' or $type == 'createdby') { diff --git a/module/doc/model.php b/module/doc/model.php index 25fdb1a30f..7801248421 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -575,7 +575,8 @@ class docModel extends model */ public function getObjectsByDoc($docIdList = array()) { - if(empty($docIdList)) return array(); + $projects = $executions = $products = array(); + if(empty($docIdList)) return array($projects, $executions, $products); $projects = $this->dao->select('t1.id, t1.name')->from(TABLE_PROJECT)->alias('t1') ->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.project') @@ -3061,7 +3062,7 @@ class docModel extends model $myLib->objectID = 0; $myLib->active = 0; $myLib->hasAction = false; - $myLib->active = $libID ? 1 : 0; + $myLib->active = zget($this->app->rawParams, 'type', '') == 'mine' ? 1 : 0; $myLib->children = $libTree; $myView = new stdclass();