From effa6ae4054ff7c2c6453a5154cda833e7ffde7b Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 8 Jan 2025 13:13:38 +0800 Subject: [PATCH] * [misc,done,0.5h] filter cases by branch. --- module/testcase/model.php | 3 ++- module/testcase/zen.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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);