* [task#130379,doing,0.5h] Process bug to testcase.

This commit is contained in:
xieqiyu
2024-10-21 11:24:21 +08:00
committed by 胡方舟
parent 0787bae1da
commit d41ab628e9
+11 -1
View File
@@ -10062,7 +10062,7 @@ class upgradeModel extends model
}
/* Process case link case. */
$caseList = $this->dao->select('id,story,linkCase')->from(TABLE_CASE)->where('linkCase')->ne('')->orWhere('story')->ne(0)->fetchAll('id');
$caseList = $this->dao->select('id,story,linkCase,fromBug')->from(TABLE_CASE)->where('linkCase')->ne('')->orWhere('story')->ne(0)->orWhere('fromBug')->ne(0)->fetchAll('id');
foreach($caseList as $caseID => $case)
{
foreach(explode(',', ",{$case->linkCase},") as $relatedCaseID)
@@ -10086,6 +10086,16 @@ class upgradeModel extends model
$relation->BID = $caseID;
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
}
if(!empty($case->fromBug))
{
$relation = new stdClass();
$relation->AType = 'bug';
$relation->AID = $case->fromBug;
$relation->relation = 'generated';
$relation->BType = 'testcase';
$relation->BID = $caseID;
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
}
}
/* Process issue link risk. */