From 5f12dbc1e559329877cfde3fd03eb3ef226ec636 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 31 Mar 2023 15:33:18 +0800 Subject: [PATCH] * Fix bug #33612. --- module/doc/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/doc/model.php b/module/doc/model.php index 73a0989aa2..14e7c53528 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -618,7 +618,7 @@ class docModel extends model */ public function getDocs($libID, $module, $browseType, $orderBy, $pager = null) { - $docIdList = $this->getPrivDocs($libID, $module); + $docIdList = $this->getPrivDocs($libID, $module, 'children'); return $this->dao->select('*')->from(TABLE_DOC) ->where('deleted')->eq(0) ->andWhere('vision')->eq($this->config->vision) @@ -641,13 +641,13 @@ class docModel extends model */ public function getPrivDocs($libIdList = array(), $module = 0, $mode = 'normal') { + $modules = $module && $mode == 'children' ? $this->loadModel('tree')->getAllChildID($module) : $module; $stmt = $this->dao->select('*')->from(TABLE_DOC) ->where('1=1') + ->andWhere('module')->in($modules) ->beginIF($mode == 'normal')->andWhere('deleted')->eq(0)->fi() ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() ->beginIF($libIdList)->andWhere('lib')->in($libIdList)->fi() - ->beginIF(strpos($this->config->doc->custom->showLibs, 'children') === false)->andWhere('module')->in($module)->fi() - ->beginIF(!empty($module) and strpos($this->config->doc->custom->showLibs, 'children') !== false)->andWhere('module')->in($module)->fi() ->query(); $docIdList = array();