* finish task #3334,3323.
This commit is contained in:
@@ -99,17 +99,17 @@ class testtaskModel extends model
|
||||
*/
|
||||
public function getProductTasks($productID, $branch = 0, $orderBy = 'id_desc', $pager = null, $scopeAndStatus = array(), $beginTime = 0, $endTime = 0)
|
||||
{
|
||||
$projects = $this->loadModel('project')->getPairs();
|
||||
if($scopeAndStatus[0] == 'all') $products = $this->loadModel('product')->getPairs();
|
||||
if($this->config->global->flow == 'onlyTest')
|
||||
{
|
||||
return $this->dao->select("t1.*, t2.name AS productName, t4.name AS buildName, t4.branch AS branch")
|
||||
return $this->dao->select("t1.*, t2.name AS productName,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_BUILD)->alias('t4')->on('t1.build = t4.id')
|
||||
->where('t1.deleted')->eq(0)
|
||||
->andWhere('t2.id')->in(array_keys($projects))
|
||||
->beginIF($scopeAndStatus[0] == 'local')->andWhere('t1.product')->eq((int)$productID)->fi()
|
||||
->beginIF($scopeAndStatus[1] == 'totalStatus')->andWhere('t1.status')->in(array('blocked','doing','wait','done'))->fi()
|
||||
->beginIF($scopeAndStatus[0] == 'all')->andWhere('t1.product')->in(array_keys($products))->fi()
|
||||
->beginIF($scopeAndStatus[1] == 'totalStatus')->andWhere('t1.status')->in(('blocked,doing,wait,done'))->fi()
|
||||
->beginIF($scopeAndStatus[1] != 'totalStatus')->andWhere('t1.status')->eq($scopeAndStatus[1])->fi()
|
||||
->beginIF($branch)->andWhere("t4.branch = '$branch'")->fi()
|
||||
->orderBy($orderBy)
|
||||
@@ -118,7 +118,8 @@ class testtaskModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
$testTask = $this->dao->select("t1.*, t2.name AS productName, t3.name AS projectName, t4.name AS buildName, if(t4.name != '', t4.branch, t5.branch) AS branch")
|
||||
$projects = $this->loadModel('project')->getPairs();
|
||||
return $this->dao->select("t1.*, t2.name AS productName, t3.name AS projectName, t4.name AS buildName, if(t4.name != '', t4.branch, t5.branch) AS branch")
|
||||
->from(TABLE_TESTTASK)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id')
|
||||
@@ -129,6 +130,7 @@ class testtaskModel extends model
|
||||
->andWhere('t5.product = t1.product')
|
||||
->andWhere('t3.id')->in(array_keys($projects))
|
||||
->beginIF($scopeAndStatus[0] == 'local')->andWhere('t1.product')->eq((int)$productID)->fi()
|
||||
->beginIF($scopeAndStatus[0] == 'all')->andWhere('t1.product')->in(array_keys($products))->fi()
|
||||
->beginIF($scopeAndStatus[1] == 'totalStatus')->andWhere('t1.status')->in('blocked,doing,wait,done')->fi()
|
||||
->beginIF($scopeAndStatus[1] != 'totalStatus')->andWhere('t1.status')->eq($scopeAndStatus[1])->fi()
|
||||
->beginIF($branch)->andWhere("if(t4.branch, t4.branch, t5.branch) = '$branch'")->fi()
|
||||
@@ -137,9 +139,6 @@ class testtaskModel extends model
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
|
||||
$projectTeam = $this->dao->select('project, account')->from(TABLE_TEAM)->where('account')->eq($this->app->user->account)->fetchAll('project');
|
||||
return $testTask;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user