* [misc,done,0.5h] filter cases by branch.

This commit is contained in:
liumengyi
2025-01-08 13:15:40 +08:00
committed by 田淑杰
parent 6ee5dd1d29
commit effa6ae405
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -2342,7 +2342,7 @@ class testcaseModel extends model
* @access public
* @return array
*/
function getCaseListForXmindExport(int $productID, int $moduleID): array
function getCaseListForXmindExport(int $productID, int $moduleID, string $branch = ''): array
{
$fields = 't1.id AS testcaseID, t1.title AS `name`, t1.pri, t2.id AS productID, t2.`name` AS productName, t3.id AS moduleID, t3.`name` AS moduleName, t4.id AS sceneID, t4.title AS sceneName, t1.precondition';
return $this->dao->select($fields)->from(TABLE_CASE)->alias('t1')
@@ -2352,6 +2352,7 @@ class testcaseModel extends model
->where('t1.deleted')->eq('0')
->andWhere('t1.product')->eq($productID)
->beginIF($moduleID)->andWhere('t1.module')->eq($moduleID)->fi()
->beginIF($branch !== '' && $branch !== 'all')->andWhere('t1.branch')->eq($branch)->fi()
->fetchAll();
}
+1 -1
View File
@@ -2655,7 +2655,7 @@ class testcaseZen extends testcase
*/
protected function getMindExport(string $type, int $productID, int $moduleID, string $branch): array
{
$caseList = $this->testcase->getCaseListForXmindExport($productID, $moduleID);
$caseList = $this->testcase->getCaseListForXmindExport($productID, $moduleID, $branch);
$stepList = $this->testcase->getStepByProductAndModule($productID, $moduleID);
$moduleList = $this->getModuleListForXmindExport($productID, $moduleID, $branch);
$sceneInfo = $this->testcase->getSceneByProductAndModule($productID, $moduleID);