diff --git a/module/testcase/model.php b/module/testcase/model.php index 5da9edc5ee..73ce01e56d 100755 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -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(); } diff --git a/module/testcase/zen.php b/module/testcase/zen.php index b7556c469d..2556218a65 100755 --- a/module/testcase/zen.php +++ b/module/testcase/zen.php @@ -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);