This commit is contained in:
hufangzhou
2021-03-25 09:33:23 +08:00
parent 800d33a25d
commit c9e522fd7d
2 changed files with 12 additions and 4 deletions
+7 -2
View File
@@ -502,8 +502,13 @@ class testcaseModel extends model
if(strpos($caseQuery, $allBranch) !== false) $caseQuery = str_replace($allBranch, '1', $caseQuery);
$caseQuery .= ')';
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($caseQuery)
->beginIF($queryProductID != 'all')->andWhere('product')->eq($productID)->fi()
if($this->app->openApp == 'project') $caseQuery = str_replace('`product`', 't2.`product`', $caseQuery);
$cases = $this->dao->select('*')->from(TABLE_CASE)
->beginIF($this->app->openApp == 'project')->alias('t1')->fi()
->beginIF($this->app->openApp == 'project')->leftJoin(TABLE_PROJECTCASE)->alias('t2')->on('t1.id=t2.case')->fi()
->where($caseQuery)
->beginIF($this->app->openApp == 'project')->andWhere('t2.project')->eq($this->session->project)->fi()
->beginIF(!empty($productID) and $queryProductID != 'all')->andWhere('product')->eq($productID)->fi()
->beginIF($auto != 'unit')->andWhere('auto')->ne('unit')->fi()
->beginIF($auto == 'unit')->andWhere('auto')->eq('unit')->fi()
->andWhere('deleted')->eq(0)