* Fix bug#3544.

This commit is contained in:
qiyu-xie
2020-10-10 16:38:45 +08:00
parent 896c57edba
commit 2ae42d3d16
2 changed files with 24 additions and 4 deletions
+4 -4
View File
@@ -445,7 +445,7 @@ class testreport extends control
$tasks = $report->tasks ? $this->testtask->getByList($report->tasks) : array();;
$builds = $report->builds ? $this->build->getByList($report->builds) : array();
$cases = $this->testreport->getTaskCases($tasks, $report->begin, $report->end, $report->cases, $pager);
$totalCases = $this->testreport->getTaskCases($tasks, $report->begin, $report->end, $report->cases);
$caseIdList = $this->testreport->getCaseIdList($reportID);
$bugInfo = $this->testreport->getBugInfo($tasks, $report->product, $report->begin, $report->end, $builds);
if($report->objectType == 'testtask')
@@ -473,10 +473,10 @@ class testreport extends control
$this->view->actions = $this->loadModel('action')->getList('testreport', $reportID);
$this->view->storySummary = $this->product->summary($stories);
$this->view->caseSummary = $this->testreport->getResultSummary($tasks, $totalCases, $report->begin, $report->end);
$this->view->caseSummary = $this->testreport->getResultSummary($tasks, $caseIdList, $report->begin, $report->end);
$perCaseResult = $this->testreport->getPerCaseResult4Report($tasks, $totalCases, $report->begin, $report->end);
$perCaseRunner = $this->testreport->getPerCaseRunner4Report($tasks, $totalCases, $report->begin, $report->end);
$perCaseResult = $this->testreport->getPerCaseResult4Report($tasks, $caseIdList, $report->begin, $report->end);
$perCaseRunner = $this->testreport->getPerCaseRunner4Report($tasks, $caseIdList, $report->begin, $report->end);
$this->view->datas['testTaskPerRunResult'] = $this->loadModel('report')->computePercent($perCaseResult);
$this->view->datas['testTaskPerRunner'] = $this->report->computePercent($perCaseRunner);
+20
View File
@@ -362,6 +362,24 @@ class testreportModel extends model
return $cases;
}
/**
* Get caseID list.
*
* @param int $reportID
* @access public
* @return void
*/
public function getCaseIdList($reportID)
{
$caseIdList = $this->dao->select('`case`')->from(TABLE_TESTREPORT)->alias('t1')
->leftJoin(TABLE_TESTRUN)->alias('t2')->on('t1.tasks=t2.task')
->where('t1.id')->eq($reportID)
->andWhere('t1.deleted')->eq(0)
->fetchPairs('case');
return $caseIdList;
}
/**
* Get result summary.
*
@@ -409,6 +427,7 @@ class testreportModel extends model
->leftJoin(TABLE_TESTRUN)->alias('t2')
->on('t1.run= t2.id')
->where('t2.task')->in(array_keys($tasks))
->andwhere('t1.date = t2.lastRunDate')
->andWhere('t1.`case`')->in(array_keys($cases))
->andWhere('t1.date')->ge($begin)
->andWhere('t1.date')->le($end . " 23:59:59")
@@ -440,6 +459,7 @@ class testreportModel extends model
->leftJoin(TABLE_TESTRUN)->alias('t2')
->on('t1.run= t2.id')
->where('t2.task')->in(array_keys($tasks))
->andwhere('t1.date = t2.lastRunDate')
->andWhere('t1.`case`')->in(array_keys($cases))
->andWhere('t1.date')->ge($begin)
->andWhere('t1.date')->le($end . " 23:59:59")