* Fix bug#17079.

This commit is contained in:
xieqiyu
2021-12-06 09:33:41 +08:00
parent 5a8e51a9c6
commit 4de8fc462f
+2 -3
View File
@@ -72,12 +72,11 @@ class testtaskModel extends model
{
$products = $scopeAndStatus[0] == 'all' ? $this->app->user->view->products : array();
return $this->dao->select("t1.*, t2.name AS productName, t3.name AS executionName, t4.name AS buildName, if(t4.name != '', t4.branch, t5.branch) AS branch")
return $this->dao->select("t1.*, t2.name AS productName, t3.name AS executionName, t4.name AS buildName, t4.branch AS branch")
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->leftJoin(TABLE_EXECUTION)->alias('t3')->on('t1.execution = t3.id')
->leftJoin(TABLE_BUILD)->alias('t4')->on('t1.build = t4.id')
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.execution = t5.project and t1.product = t5.product')
->where('t1.deleted')->eq(0)
->andWhere('t1.auto')->ne('unit')
@@ -86,7 +85,7 @@ class testtaskModel extends model
->beginIF($scopeAndStatus[0] == 'all')->andWhere('t1.product')->in($products)->fi()
->beginIF(strtolower($scopeAndStatus[1]) == 'totalstatus')->andWhere('t1.status')->in('blocked,doing,wait,done')->fi()
->beginIF(strtolower($scopeAndStatus[1]) != 'totalstatus')->andWhere('t1.status')->eq($scopeAndStatus[1])->fi()
->beginIF($branch !== 'all')->andWhere("if(t4.branch, t4.branch, t5.branch) = '$branch'")->fi()
->beginIF($branch !== 'all')->andWhere('t4.branch')->eq($branch)->fi()
->beginIF($beginTime)->andWhere('t1.begin')->ge($beginTime)->fi()
->beginIF($endTime)->andWhere('t1.end')->le($endTime)->fi()
->orderBy($orderBy)