* Adjust story, bug, task linked mr data.
This commit is contained in:
+2
-2
@@ -1106,13 +1106,13 @@ class mrModel extends model
|
||||
*/
|
||||
public function getLinkedMRPairs(int $objectID, string $objectType = 'story'): array
|
||||
{
|
||||
return $this->dao->select("t2.id,t2.title")->from(TABLE_RELATION)->alias('t1')
|
||||
return $this->dao->select("t2.id,t2.title,t2.status")->from(TABLE_RELATION)->alias('t1')
|
||||
->leftJoin(TABLE_MR)->alias('t2')->on('t1.AID = t2.id')
|
||||
->where('t1.AType')->eq('mr')
|
||||
->andWhere('t1.BType')->eq($objectType)
|
||||
->andWhere('t1.BID')->eq($objectID)
|
||||
->andWhere('t2.id')->ne(0)
|
||||
->fetchPairs();
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,11 +7,17 @@ title=测试 mrModel::getLinkedMRPairs();
|
||||
timeout=0
|
||||
cid=0
|
||||
|
||||
- 查询ID为1的需求关联的MR列表属性1 @test-merge
|
||||
- 查询ID为1的需求关联的MR列表
|
||||
- 第1条的title属性 @test-merge
|
||||
- 第1条的status属性 @opened
|
||||
- 查询ID为1的任务关联的MR列表 @0
|
||||
- 查询ID为1的Bug关联的MR列表 @0
|
||||
- 查询ID为2的任务关联的MR列表属性1 @test-merge
|
||||
- 查询ID为3的Bug关联的MR列表属性1 @test-merge
|
||||
- 查询ID为2的任务关联的MR列表
|
||||
- 第1条的title属性 @test-merge
|
||||
- 第1条的status属性 @opened
|
||||
- 查询ID为3的Bug关联的MR列表
|
||||
- 第1条的title属性 @test-merge
|
||||
- 第1条的status属性 @opened
|
||||
- 错误的类型 @0
|
||||
|
||||
*/
|
||||
@@ -26,14 +32,14 @@ global $tester;
|
||||
$mrModel = $tester->loadModel('mr');
|
||||
|
||||
/* Object id and type is right. */
|
||||
r($mrModel->getLinkedMRPairs(1, 'story')) && p('1') && e('test-merge'); // 查询ID为1的需求关联的MR列表
|
||||
r($mrModel->getLinkedMRPairs(1, 'story')) && p('1:title,status') && e('test-merge,opened'); // 查询ID为1的需求关联的MR列表
|
||||
|
||||
r($mrModel->getLinkedMRPairs(1, 'task')) && p() && e('0'); // 查询ID为1的任务关联的MR列表
|
||||
r($mrModel->getLinkedMRPairs(1, 'bug')) && p() && e('0'); // 查询ID为1的Bug关联的MR列表
|
||||
|
||||
r($mrModel->getLinkedMRPairs(2, 'task')) && p('1') && e('test-merge'); // 查询ID为2的任务关联的MR列表
|
||||
r($mrModel->getLinkedMRPairs(2, 'task')) && p('1:title,status') && e('test-merge,opened'); // 查询ID为2的任务关联的MR列表
|
||||
|
||||
r($mrModel->getLinkedMRPairs(3, 'bug')) && p('1') && e('test-merge'); // 查询ID为3的Bug关联的MR列表
|
||||
r($mrModel->getLinkedMRPairs(3, 'bug')) && p('1:title,status') && e('test-merge,opened'); // 查询ID为3的Bug关联的MR列表
|
||||
|
||||
/* Type is wrong. */
|
||||
r($mrModel->getLinkedMRPairs(1, 'story1')) && p() && e('0'); // 错误的类型
|
||||
Reference in New Issue
Block a user