Merge branch dev/bug-63516 of zentao/zentaopms (#9735)

This commit is contained in:
刘刚
2025-06-20 15:03:17 +08:00
committed by Gitfox
2 changed files with 9 additions and 11 deletions
+3 -5
View File
@@ -484,12 +484,10 @@ class storyTao extends storyModel
protected function getModules4ExecutionStories(string $type, string $param): array
{
$moduleID = (int)($type == 'bymodule' && $param !== '' ? $param : $this->cookie->storyModuleParam);
if(empty($moduleID))
{
if(!empty($type) && strpos('allstory,unclosed,bymodule', $type) !== false) return $this->dao->select('id')->from(TABLE_MODULE)->where('deleted')->eq('0')->andWhere('type')->eq('story')->fetchPairs();
return [];
}
/* 如果模块为空,或者标签不是所有需求,未关闭的需求,某个模块下的需求时,获取所有模块下的需求。*/
/* If the module is empty, or type is not allstory, unclosed, or bymodule, get the stories under all modules. */
if(empty($moduleID) || strpos('allstory,unclosed,bymodule', $type) === false) return [];
/* 从缓存中获取模块路径然后在 LIKE 查询中使用左匹配以利用索引提高性能。Find the path of the module from cache and use left match in like query to improve performance. */
$path = $this->mao->select('path')->from(TABLE_MODULE)->where('id')->eq($moduleID)->fetch('path');
@@ -10,10 +10,10 @@ cid=0
- 不传入数据。 @0
- 传入 type=byproduct,不传入 param 参数。 @0
- 传入 type=byproduct 和 param 参数。 @0
- 传入 type=bymodule,不传入 param 参数。属性2 @2
- 传入 type=bymodule,不传入 param 参数。 @0
- 传入 type=bymodule 和 param 参数。属性1 @1
- 设置COOKIE,传入 type=byproduct,不传入 param 参数。属性2 @2
- 设置COOKIE,传入 type=byproduct 和 param 参数。属性2 @2
- 设置COOKIE,传入 type=byproduct,不传入 param 参数。 @0
- 设置COOKIE,传入 type=byproduct 和 param 参数。 @0
- 设置COOKIE,传入 type,不传入 param 参数。属性2 @2
- 设置COOKIE,传入 type=bymodule 和 param 参数。属性1 @1
@@ -29,11 +29,11 @@ $storyModel = $tester->loadModel('story');
r($storyModel->getModules4ExecutionStories('', '')) && p() && e('0'); //不传入数据。
r($storyModel->getModules4ExecutionStories('byproduct', '')) && p() && e('0'); //传入 type=byproduct,不传入 param 参数。
r($storyModel->getModules4ExecutionStories('byproduct', '1')) && p() && e('0'); //传入 type=byproduct 和 param 参数。
r($storyModel->getModules4ExecutionStories('bymodule', '')) && p(2) && e('2'); //传入 type=bymodule,不传入 param 参数。
r($storyModel->getModules4ExecutionStories('bymodule', '')) && p() && e('0'); //传入 type=bymodule,不传入 param 参数。
r($storyModel->getModules4ExecutionStories('bymodule', '1')) && p(1) && e('1'); //传入 type=bymodule 和 param 参数。
$_COOKIE['storyModuleParam'] = 2;
r($storyModel->getModules4ExecutionStories('byproduct', '')) && p(2) && e('2'); //设置COOKIE,传入 type=byproduct,不传入 param 参数。
r($storyModel->getModules4ExecutionStories('byproduct', '1')) && p(2) && e('2'); //设置COOKIE,传入 type=byproduct 和 param 参数。
r($storyModel->getModules4ExecutionStories('byproduct', '')) && p() && e('0'); //设置COOKIE,传入 type=byproduct,不传入 param 参数。
r($storyModel->getModules4ExecutionStories('byproduct', '1')) && p() && e('0'); //设置COOKIE,传入 type=byproduct 和 param 参数。
r($storyModel->getModules4ExecutionStories('bymodule', '')) && p(2) && e('2'); //设置COOKIE,传入 type,不传入 param 参数。
r($storyModel->getModules4ExecutionStories('bymodule', '1')) && p(1) && e('1'); //设置COOKIE,传入 type=bymodule 和 param 参数。