* [bug#62413] Fix the bug of create doc select case template in project.

This commit is contained in:
xieqiyu
2025-05-16 16:08:51 +08:00
committed by 刘刚
parent db81957195
commit b92237e1ca
+3 -3
View File
@@ -50,7 +50,7 @@ class testcaseTao extends testcaseModel
* 获取某个项目下某个模块的用例列表。
* Get project cases of a module.
*
* @param int $productID
* @param int|array $productID
* @param int|string $branch
* @param int $moduleIdList
* @param string $browseType
@@ -61,14 +61,14 @@ class testcaseTao extends testcaseModel
* @access protected
* @return array
*/
protected function getModuleProjectCases(int $productID, int|string $branch = 0, int|array $moduleIdList = 0, string $browseType = '', string $auto = 'no', string $caseType = '', string $orderBy = 'id_desc', object $pager = null): array
protected function getModuleProjectCases(int|array $productID, int|string $branch = 0, int|array $moduleIdList = 0, string $browseType = '', string $auto = 'no', string $caseType = '', string $orderBy = 'id_desc', object $pager = null): array
{
return $this->dao->select('distinct t1.*, t2.*, t4.title AS storyTitle')->from(TABLE_PROJECTCASE)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->leftJoin(TABLE_PROJECTSTORY)->alias('t3')->on('t3.story = t2.story')
->leftJoin(TABLE_STORY)->alias('t4')->on('t3.story = t4.id')
->where('t1.project')->eq((int)$this->session->project)
->beginIF(!empty($productID))->andWhere('t2.product')->eq($productID)->fi()
->beginIF(!empty($productID))->andWhere('t2.product')->in($productID)->fi()
->beginIF(!empty($productID) && $branch !== 'all')->andWhere('t2.branch')->eq($branch)->fi()
->beginIF($moduleIdList)->andWhere('t2.module')->in($moduleIdList)->fi()
->beginIF($browseType == 'all')->andWhere('t2.scene')->eq(0)->fi()