* [refac bug #64295] Get case title from casespec table.

This commit is contained in:
wangyidong
2025-08-06 15:22:14 +08:00
committed by tianshujie
parent fc1ba52f2d
commit c90f09e650
+8 -4
View File
@@ -1000,9 +1000,10 @@ class testtaskModel extends model
{
$orderBy = $this->addPrefixToOrderBy($orderBy);
return $this->dao->select('t2.*, t1.*, t2.version as caseVersion, t3.title AS storyTitle, t2.status AS caseStatus')->from(TABLE_TESTRUN)->alias('t1')
return $this->dao->select('t2.*, t1.*, t2.version as caseVersion, t3.title AS storyTitle, t2.status AS caseStatus, IF(t4.title IS NULL, t2.title, t4.title) AS title')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->leftJoin(TABLE_STORY)->alias('t3')->on('t2.story = t3.id')
->leftJoin(TABLE_CASESPEC)->alias('t4')->on('t1.case = t4.case && t1.version = t4.version')
->where('t1.task')->eq($taskID)
->andWhere('t2.deleted')->eq('0')
->beginIF($modules)->andWhere('t2.module')->in($modules)->fi()
@@ -1027,9 +1028,10 @@ class testtaskModel extends model
$orderBy = $this->addPrefixToOrderBy($orderBy);
$cases = $this->loadModel('testsuite')->getLinkedCasePairs($suiteID);
return $this->dao->select('t2.*,t1.*,t3.title as storyTitle,t2.status as caseStatus,t2.version as caseVersion')->from(TABLE_TESTRUN)->alias('t1')
return $this->dao->select('t2.*,t1.*,t3.title as storyTitle,t2.status as caseStatus,t2.version as caseVersion, IF(t4.title IS NULL, t2.title, t4.title) AS title')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->leftJoin(TABLE_STORY)->alias('t3')->on('t2.story = t3.id')
->leftJoin(TABLE_CASESPEC)->alias('t4')->on('t1.case = t4.case && t1.version = t4.version')
->where('t1.task')->eq($taskID)
->andWhere('t2.deleted')->eq('0')
->andWhere('t2.id')->in(array_keys($cases))
@@ -1076,9 +1078,10 @@ class testtaskModel extends model
{
$orderBy = $this->addPrefixToOrderBy($orderBy);
return $this->dao->select('t2.*, t1.*, t3.title AS storyTitle, t2.status AS caseStatus,t2.version AS caseVersion')->from(TABLE_TESTRUN)->alias('t1')
return $this->dao->select('t2.*, t1.*, t3.title AS storyTitle, t2.status AS caseStatus,t2.version AS caseVersion, IF(t4.title IS NULL, t2.title, t4.title) AS title')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->leftJoin(TABLE_STORY)->alias('t3')->on('t2.story = t3.id')
->leftJoin(TABLE_CASESPEC)->alias('t4')->on('t1.case = t4.case && t1.version = t4.version')
->where('t1.task')->eq($taskID)
->andWhere('t1.assignedTo')->eq($user)
->andWhere('t2.deleted')->eq('0')
@@ -1187,9 +1190,10 @@ class testtaskModel extends model
$caseQuery = str_replace(array('t2.`assignedTo`', 't2.`lastRunner`', 't2.`lastRunDate`', 't2.`lastRunResult`'), array('t1.`assignedTo`', 't1.`lastRunner`', 't1.`lastRunDate`', 't1.`lastRunResult`'), $caseQuery);
$orderBy = $this->addPrefixToOrderBy($sort);
return $this->dao->select('t2.*, t1.*, t3.title AS storyTitle, t2.status AS caseStatus, t2.version AS caseVersion')->from(TABLE_TESTRUN)->alias('t1')
return $this->dao->select('t2.*, t1.*, t3.title AS storyTitle, t2.status AS caseStatus, t2.version AS caseVersion, IF(t4.title IS NULL, t2.title, t4.title) AS title')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->leftJoin(TABLE_STORY)->alias('t3')->on('t2.story = t3.id')
->leftJoin(TABLE_CASESPEC)->alias('t4')->on('t1.case = t4.case && t1.version = t4.version')
->where($caseQuery)
->andWhere('t1.task')->eq($task->id)
->andWhere('t2.deleted')->eq('0')