* testcase: only display automated cases when check the only automated option.

This commit is contained in:
liugang
2023-06-30 13:10:51 +08:00
parent 770cdec0a8
commit f3ef1d60f1
2 changed files with 26 additions and 18 deletions
+11 -8
View File
@@ -218,8 +218,8 @@ class testcaseModel extends model
->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi()
->beginIF($browseType == 'wait')->andWhere('t1.status')->eq($browseType)->fi()
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
->beginIF($this->cookie->onlyAutoCase)->andWhere('t1.auto')->eq('auto')->fi()
->beginIF($auto == 'auto')->andWhere('t1.auto')->eq('auto')->fi()
->beginIF($auto != 'unit' && $auto != 'auto')->andWhere('t1.auto')->notIn('unit, auto')->fi()
->beginIF($caseType)->andWhere('t1.type')->eq($caseType)->fi()
->andWhere('t1.deleted')->eq('0')
->orderBy($orderBy)
@@ -256,8 +256,8 @@ class testcaseModel extends model
->beginIF($moduleIdList)->andWhere('t2.module')->in($moduleIdList)->fi()
->beginIF($browseType == 'wait')->andWhere('t2.status')->eq($browseType)->fi()
->beginIF($auto == 'unit')->andWhere('t2.auto')->eq('unit')->fi()
->beginIF($auto != 'unit')->andWhere('t2.auto')->ne('unit')->fi()
->beginIF($this->cookie->onlyAutoCase)->andWhere('t2.auto')->eq('auto')->fi()
->beginIF($auto == 'auto')->andWhere('t2.auto')->eq('auto')->fi()
->beginIF($auto != 'unit' && $auto != 'auto')->andWhere('t2.auto')->notIn('unit, auto')->fi()
->beginIF($caseType)->andWhere('t2.type')->eq($caseType)->fi()
->andWhere('t2.deleted')->eq('0')
->orderBy($orderBy)
@@ -358,7 +358,8 @@ class testcaseModel extends model
->beginIF($branch !== 'all')->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi()
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
->beginIF($auto == 'auto')->andWhere('t1.auto')->eq('auto')->fi()
->beginIF($auto != 'unit' && $auto != 'auto')->andWhere('t1.auto')->notIn('unit, auto')->fi()
->andWhere('t1.deleted')->eq('0')
->orderBy($orderBy)->page($pager)->fetchAll('id');
}
@@ -523,9 +524,9 @@ class testcaseModel extends model
->beginIF($this->app->tab == 'project')->andWhere('t3.project')->eq($this->session->project)->fi()
->beginIF($branch !== 'all' and !empty($productID))->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($modules)->andWhere('t1.module')->in($modules)->fi()
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
->beginIF($this->cookie->onlyAutoCase)->andWhere('t1.auto')->eq('auto')->fi()
->beginIF($auto == 'auto')->andWhere('t1.auto')->eq('auto')->fi()
->beginIF($auto != 'unit' && $auto != 'auto')->andWhere('t1.auto')->notIn('unit, auto')->fi()
->beginIF($caseType)->andWhere('t1.type')->eq($caseType)->fi()
->orderBy($sort)
->page($pager, 't1.id')
@@ -3302,8 +3303,9 @@ class testcaseModel extends model
->beginIF($this->app->tab == 'project')->andWhere('t2.project')->eq($this->session->project)->fi()
->beginIF($this->app->tab == 'project' and !empty($productID) and $queryProductID != 'all')->andWhere('t2.product')->eq($productID)->fi()
->beginIF($this->app->tab != 'project' and !empty($productID) and $queryProductID != 'all')->andWhere('t1.product')->eq($productID)->fi()
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
->beginIF($auto == 'auto')->andWhere('t1.auto')->eq('auto')->fi()
->beginIF($auto != 'unit' && $auto != 'auto')->andWhere('t1.auto')->notIn('unit, auto')->fi()
->andWhere('t1.deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll('id');
@@ -3401,6 +3403,7 @@ class testcaseModel extends model
$rawModule = $this->app->rawModule;
return $this->dao->select('*')->from(VIEW_SCENECASE)
->where('deleted')->eq(0)
->beginIF($this->cookie->onlyAutoCase)->andWhere('isCase')->eq(1)->fi()
->beginIF($browseType == 'onlyscene')->andWhere('isCase')->eq(2)->fi()
->beginIF($modules)->andWhere('module')->in($modules)->fi()
->beginIF($rawMethod == 'browse' and $type === 'top')->andWhere('parent')->eq(0)->andWhere('id')->in($objectIdList)->fi()