+ [bug#51740,start,1h,1h] add search method for execution::testcase.

This commit is contained in:
liumengyi
2024-07-02 14:35:38 +08:00
committed by 田淑杰
parent 68b503f999
commit 092a1ea0d6
+20
View File
@@ -744,8 +744,28 @@ class testcaseTao extends testcaseModel
}
}
if($this->session->executionCaseQuery === false) $this->session->set('executionCaseQuery', ' 1 = 1');
$caseQuery = '(' . $this->session->executionCaseQuery;
/* 处理用例查询中的产品条件。*/
if(strpos($this->session->executionCaseQuery, "`product` = 'all'") !== false)
{
$caseQuery = str_replace("`product` = 'all'", '1 = 1', $caseQuery);
$caseQuery .= ' AND t2.`product` ' . helper::dbIN($this->app->user->view->products);
}
elseif($productID)
{
$caseQuery .= " AND t2.`product` ='$productID'";
}
/* 处理用例查询中的产品分支条件。*/
if(strpos($caseQuery, "`branch` = 'all'") !== false) $caseQuery = str_replace("`branch` = 'all'", '1 = 1', $caseQuery);
if($branchID !== 'all' && strpos($caseQuery, '`branch` =') === false) $caseQuery .= " AND t2.`branch` in ('$branchID')";
/* 处理用例查询中的版本条件。*/
$caseQuery = str_replace('`version`', 't2.`version`', $caseQuery);
$caseQuery .= ')';
return $this->dao->select('distinct t1.*, t2.*')->from(TABLE_PROJECTCASE)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->where('t1.project')->eq($executionID)