From 0b024533711dc240bfc821a03a767c16d104ceda Mon Sep 17 00:00:00 2001 From: sunguangming Date: Tue, 3 Jun 2025 07:12:35 +0000 Subject: [PATCH] * [task#144288,done,0.5h] fix bug. --- lib/base/dao/dao.class.php | 8 +++----- module/doc/model.php | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index d1855ec3f8..6212589ceb 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -847,7 +847,7 @@ class baseDAO * @access public * @return string the sql string after process. */ - public function processSQL() + public function processSQL($filterTpl = true) { $sql = $this->sqlobj->get(); @@ -882,7 +882,7 @@ class baseDAO $sql .= '(`' . implode('`,`', array_keys($values)) . '`)' . ' VALUES(' . implode(',', $values) . ')'; } - elseif($this->method == 'select' && dao::$filterTpl == 'always') + elseif($this->method == 'select' && dao::$filterTpl == 'always' && $filterTpl) { /* 过滤模板类型的数据 */ foreach(array('project', 'task') as $table) @@ -1294,9 +1294,7 @@ class baseDAO */ public function fetch($field = '') { - $this->filterTpl('skip'); - - $sql = $this->processSQL(); + $sql = $this->processSQL(false); $key = $this->createCacheKey('fetch', md5($sql)); $result = $this->getCache($key); if($result === self::CACHE_MISS) diff --git a/module/doc/model.php b/module/doc/model.php index 8ce2ec24e6..6718396617 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -127,10 +127,10 @@ class docModel extends model */ public function getLibs(string $type = '', string $extra = '', int|string $appendLibs = '', int $objectID = 0, string $excludeType = ''): array { - dao::$filterTpl = false; + dao::$filterTpl = 'skip'; - $products = $this->loadModel('product')->getPairs(); $projects = $this->loadModel('project')->getPairsByProgram(0, 'all', false, 'order_asc'); + $products = $this->loadModel('product')->getPairs(); $executions = $this->loadModel('execution')->getPairs(0, 'all', 'multiple,leaf'); $waterfalls = array(); if(empty($objectID) && $type == 'execution')