From 98b7138f52b6d0980a1127177a8bf323c5a28d97 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 28 Sep 2023 09:26:17 +0800 Subject: [PATCH] * testtaskModel: refactor the getRunsBySuite method. --- module/testtask/model.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/testtask/model.php b/module/testtask/model.php index e4692107f1..1dc4d60b96 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -942,7 +942,8 @@ class testtaskModel extends model } /** - * Get test runs of a suite. + * 根据一个测试套件获取一个测试单关联的测试用例。 + * Get cases associated with a testtask according by a test suite. * * @param int $taskID * @param int $suiteID @@ -951,7 +952,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getRunsBySuite($taskID, $suiteID, $orderBy, $pager = null) + public function getRunsBySuite(int $taskID, int $suiteID, string $orderBy, object $pager = null): array { /* Select the table for these special fields. */ $specialFields = ',assignedTo,status,lastRunResult,lastRunner,lastRunDate,'; @@ -963,7 +964,7 @@ class testtaskModel extends model return $this->dao->select('t2.*,t1.*,t2.version as caseVersion,t3.title as storyTitle,t2.status as caseStatus')->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') - ->where('t1.task')->eq((int)$taskID) + ->where('t1.task')->eq($taskID) ->andWhere('t2.deleted')->eq('0') ->andWhere('t2.id')->in(array_keys($cases)) ->orderBy($orderBy)