* fix bug for browse testtask.

This commit is contained in:
wangyidong
2017-11-03 15:25:45 +08:00
parent 1ad2a03511
commit 37538538fa
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -99,6 +99,7 @@ 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($this->config->global->flow == 'onlyTest')
{
return $this->dao->select("t1.*, t2.name AS productName, t4.name AS buildName, t4.branch AS branch")
@@ -106,6 +107,7 @@ class testtaskModel extends model
->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[1] != 'totalStatus')->andWhere('t1.status')->eq($scopeAndStatus[1])->fi()
@@ -116,7 +118,7 @@ class testtaskModel extends model
}
else
{
$testTask = $this->dao->select("t1.*, t2.name AS productName, t3.name AS projectName, t3.acl, t3.whitelist, t4.name AS buildName, if(t4.name != '', t4.branch, t5.branch) AS branch")
$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")
->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')
@@ -125,6 +127,7 @@ class testtaskModel extends model
->where('t1.deleted')->eq(0)
->beginIF($scopeAndStatus[0] == 'local')->andWhere('t1.product')->eq((int)$productID)->fi()
->andWhere('t5.product = t1.product')
->andWhere('t3.id')->in(array_keys($projects))
->beginIF($scopeAndStatus[1] == 'totalStatus')->andWhere('t1.status')->in(array('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()
+1 -1
View File
@@ -40,7 +40,7 @@ $status = $this->session->testTaskVersionStatus;
<li id='doneTab'><?php echo html::a(inlink('browse', "productID=$productID&branch=$branch&type=$scope,done"), $lang->testtask->done);?></li>
<li id='totalStatusTab'><?php echo html::a(inlink('browse', "productID=$productID&branch=$branch&type=$scope,totalStatus"), $lang->testtask->totalStatus);?></li>
<li style='margin-left: 20px;'>
<?php $condition = "productID=$productID&branch=$branch&type=$scope,$status&orderBy=$orderBy&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID"?>
<?php $condition = "productID=$productID&branch=$branch&type=$scope,$status&orderBy=$orderBy&recTotal=0&recPerPage=$pager->recPerPage&pageID=1"?>
<div class='input-group w-400px input-group-sm'>
<span class='input-group-addon'><?php echo $lang->testtask->beginAndEnd;?></span>
<div class='datepicker-wrapper datepicker-date'><?php echo html::input('date', $beginTime, "class='w-100px form-control form-date' onchange='changeDate(this.value, \"$endTime\", \"$condition\")'");?></div>