* adjust linkCase.

This commit is contained in:
pengjiangxiu
2017-03-22 10:47:15 +08:00
parent 224923e822
commit 6b2aa9a7cb
2 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -653,7 +653,7 @@ class testtask extends control
{
if(!empty($_POST))
{
$this->testtask->linkCase($taskID);
$this->testtask->linkCase($taskID, $type);
$this->locate(inlink('cases', "taskID=$taskID"));
}
+10 -2
View File
@@ -582,11 +582,12 @@ class testtaskModel extends model
/**
* Link cases.
*
* @param int $taskID
* @param int $taskID
* @param string $type
* @access public
* @return void
*/
public function linkCase($taskID)
public function linkCase($taskID, $type)
{
if($this->post->cases == false) return;
$postData = fixer::input('post')->get();
@@ -598,6 +599,13 @@ class testtaskModel extends model
$row->version = $postData->versions[$caseID];
$row->assignedTo = '';
$row->status = 'wait';
if($type == 'bybuild')
{
$assignedTo = $this->dao->select('assignedTo')->from(TABLE_TESTRUN)->where('`case`')->eq($caseID)->fetch();
$row->assignedTo = $assignedTo->assignedTo;
}
$this->dao->replace(TABLE_TESTRUN)->data($row)->exec();
}
}