From 322e7112ccd2a1372661524ed411d744db24bad8 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Wed, 2 Dec 2020 10:14:28 +0800 Subject: [PATCH] * Fix bug. --- module/doc/model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/doc/model.php b/module/doc/model.php index 3dfdfef15e..faf2813913 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1109,6 +1109,7 @@ class docModel extends model */ public function getLimitLibs($type, $limit = 0) { + $libs = array(); if($type == 'product' or $type == 'project') { $nonzeroLibs = array(); @@ -1121,7 +1122,8 @@ class docModel extends model $projectID = $this->session->PRJ; $executionStatus = strpos($this->config->doc->custom->showLibs, 'unclosed') !== false ? 'undone' : 'all'; if($type == 'product') $objectList = $this->loadModel('product')->getProductPairsByProject($projectID, 'all'); - if($type == 'project') $objectList = $this->loadModel('project')->getExecutionsByProject($projectID, $executionStatus, 0, true); + if($type == 'project') $objectList = $this->loadModel('project')->getExecutionsByProject($projectID, 'all', 0, true); + if(empty($objectList)) $libs; $table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT; $stmt = $this->dao->select('*')->from(TABLE_DOCLIB) @@ -1136,7 +1138,6 @@ class docModel extends model } $i = 1; - $libs = array(); while($docLib = $stmt->fetch()) { if($limit && $i > $limit) break;