From 6ef8f58a4f0b97106523da6e91c33c919535d987 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 12 Apr 2023 11:13:11 +0800 Subject: [PATCH] * Fix bug #34066. --- module/doc/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/doc/model.php b/module/doc/model.php index 2b056cc306..4024a272fd 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -75,7 +75,7 @@ class docModel extends model */ public function getLibs($type = '', $extra = '', $appendLibs = '', $objectID = 0, $excludeType = '') { - if($type == 'all' or $type == 'includeDeleted') + if(in_array($type, array('all', 'includeDeleted', 'hasApi'))) { $stmt = $this->dao->select('*')->from(TABLE_DOCLIB) ->where('vision')->eq($this->config->vision) @@ -90,7 +90,7 @@ class docModel extends model $stmt = $this->dao->select('*')->from(TABLE_DOCLIB) ->where('deleted')->eq(0) ->andWhere('vision')->eq($this->config->vision) - ->beginIF($type != 'hasApi')->andWhere('type')->eq($type)->fi() + ->beginIF($type)->andWhere('type')->eq($type)->fi() ->beginIF(!$type)->andWhere('type')->ne('api')->fi() ->beginIF($objectID and strpos(',product,project,execution,', ",$type,") !== false)->andWhere($type)->eq($objectID)->fi() ->orderBy('id_asc')