Merge branch release/21.7.4 of zentao/zentaopms (#10702)

This commit is contained in:
刘刚
2025-07-31 15:44:40 +08:00
committed by Gitfox
3 changed files with 12 additions and 4 deletions
+2 -1
View File
@@ -24,6 +24,7 @@ div
set::userMap($users),
set::footPager(usePager()),
set::loadPartial(),
set::loadOptions(array('zui-command' => 'updateLazyContent', 'data-lazy-target' => '#table-api-struct'))
set::loadOptions(array('zui-command' => 'updateLazyContent', 'data-lazy-target' => '#table-api-struct')),
set::sortLink(createLink('api', 'struct', "libID={$libID}&releaseID={$releaseID}&orderBy={name}_{sortType}"))
),
);
+3 -1
View File
@@ -517,15 +517,17 @@ class storyModel extends model
* Fetch stories by project id list.
*
* @param array $projectIdList
* @param string $storyType story|requirement|epic
* @access public
* @return array
*/
public function fetchStoriesByProjectIdList(array $projectIdList = array()): array
public function fetchStoriesByProjectIdList(array $projectIdList = array(), string $storyType = ''): array
{
return $this->dao->select("t2.*,t1.project")->from(TABLE_PROJECTSTORY)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->where('t1.project')->in($projectIdList)
->andWhere('t2.deleted')->eq(0)
->beginIF(strpos(',story,requirement,epic,', ",{$storyType},") !== false)->andWhere('t2.type')->in($storyType)->fi()
->fetchGroup('project', 'id');
}
@@ -9,6 +9,10 @@ cid=0
- 不传入数据。 @1
- 传入不存在的项目ID。 @1
- 检查有关联需求项目的需求数。 @50
- 检查有关联需求项目的需求
- 第50条的id属性 @50
- 第50条的product属性 @1
- 第50条的title属性 @软件需求50
- 检查没有关联需求项目,是否在数据中存在。 @1
*/
@@ -32,5 +36,6 @@ r(empty($storyModel->fetchStoriesByProjectIdList(array()))) && p() && e('1');
r(empty($storyModel->fetchStoriesByProjectIdList(array(100)))) && p() && e('1'); //传入不存在的项目ID。
$storyGroup = $storyModel->fetchStoriesByProjectIdList(array(11, 12));
r(count($storyGroup[11])) && p() && e('50'); //检查有关联需求项目的需求数。
r(empty($storyGroup[12])) && p() && e('1'); //检查没有关联需求项目,是否在数据中存在。
r(count($storyGroup[11])) && p() && e('50'); // 检查有关联需求项目的需求数。
r($storyGroup[11]) && p('50:id,product,title') && e('50,1,软件需求50'); // 检查有关联需求项目的需求
r(empty($storyGroup[12])) && p() && e('1'); // 检查没有关联需求项目,是否在数据中存在。