+ finish task#574

This commit is contained in:
chencongzhi520@gmail.com
2011-10-22 03:13:20 +00:00
parent 9b8415e5ca
commit 90fd3d2751
7 changed files with 49 additions and 7 deletions
+12 -3
View File
@@ -242,6 +242,7 @@ class testtaskModel extends model
->remove('steps,reals,passall')
->get();
$this->dao->insert(TABLE_TESTRESULT)->data($result)->autoCheck()->exec();
$this->dao->update(TABLE_CASE)->set('lastRun')->eq($now)->set('lastResult')->eq($caseResult)->where('id')->eq($this->post->case)->exec();
if(!isset($caseID))
{
@@ -260,15 +261,23 @@ class testtaskModel extends model
}
/**
* Get results of a test run.
* Get results by runID or caseID
*
* @param int $runID
* @access public
* @return array
*/
public function getRunResults($runID)
public function getResults($runID, $caseID = 0)
{
$results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('run')->eq($runID)->orderBy('id desc')->fetchAll('id');
if($caseID != 0)
{
$results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('`case`')->eq($caseID)->orderBy('id desc')->fetchAll('id');
}
else
{
$results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('run')->eq($runID)->orderBy('id desc')->fetchAll('id');
}
if(!$results) return array();
foreach($results as $resultID => $result)
{