diff --git a/module/testreport/control.php b/module/testreport/control.php index 858ca30ff1..3f8a843c4a 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -448,7 +448,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') @@ -476,10 +476,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); diff --git a/module/testreport/model.php b/module/testreport/model.php index 7cd6a47fa4..da0e91d188 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -288,6 +288,22 @@ class testreportModel extends model return $bugInfo; } + /** + * Get caseID list + * + * @param int $reportID + * @access public + * @return void + */ + public function getCaseIDList($reportID) + { + $task = $this->dao->select('tasks')->from(TABLE_TESTREPORT)->where('id')->eq($reportID)->andWhere('deleted')->eq(0)->fetch('tasks'); + $caseIDList = $this->dao->select('`case`')->from(TABLE_TESTRUN)->where('task')->eq($task)->fetchAll('case'); + + return $caseIDList; + } + + /** * Get task cases. *