From daebbfe9434da9e6240e6d9a8a442d3219d74637 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 8 Dec 2023 15:21:32 +0800 Subject: [PATCH] - Remove unused method and unit test of doc::getSubLibGroups. --- module/doc/model.php | 27 ---------------------- module/doc/test/model/getsublibgroups.php | 28 ----------------------- 2 files changed, 55 deletions(-) delete mode 100755 module/doc/test/model/getsublibgroups.php diff --git a/module/doc/model.php b/module/doc/model.php index cacc7f48ae..3d8edd4fa9 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1243,33 +1243,6 @@ class docModel extends model return false; } - /** - * Get execution or product libs groups. - * - * @param string $type - * @param array $idList - * @access public - * @return array - */ - public function getSubLibGroups($type, $idList) - { - if($type != 'product' and $type != 'execution') return false; - $libGroups = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->in($idList)->orderBy('`order`, id')->fetchGroup($type, 'id'); - - $buildGroups = array(); - foreach($libGroups as $objectID => $libs) - { - foreach($libs as $lib) - { - if($this->checkPrivLib($lib)) $buildGroups[$objectID][$lib->id] = $lib->name; - } - - if(common::hasPriv('doc', 'showFiles')) $buildGroups[$objectID]['files'] = $this->lang->doclib->files; - } - - return $buildGroups; - } - /** * 通过对象ID获取文档库。 * Get libs by object. diff --git a/module/doc/test/model/getsublibgroups.php b/module/doc/test/model/getsublibgroups.php deleted file mode 100755 index ddb82c1b06..0000000000 --- a/module/doc/test/model/getsublibgroups.php +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env php -getSubLibGroups(); -cid=1 -pid=1 - -all查询 >> 0 -产品库查询 >> 产品主库;附件库 -执行库查询 >> 0 -产品库查询统计 >> 2 - -*/ -global $tester; -$doc = $tester->loadModel('doc'); - -$types = array('all', 'product', 'execution'); -$idList = array('17', '1'); - -r($doc->getSubLibGroups($types[0], $idList)) && p() && e('0'); //all查询 -r($doc->getSubLibGroups($types[1], $idList)[1]) && p('1;files') && e('产品主库;附件库');//产品库查询 -r($doc->getSubLibGroups($types[2], $idList)) && p() && e('0'); //执行库查询 -r(count($doc->getSubLibGroups($types[1], $idList))) && p() && e('2'); //产品库查询统计 \ No newline at end of file