From 6337469a0009f6358be50fdbaf8fc156ecbd3d72 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Tue, 18 Nov 2025 13:56:40 +0800 Subject: [PATCH 1/3] * Optimize code. --- module/testsuite/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/testsuite/model.php b/module/testsuite/model.php index dcbe97a7ee..2a919c574e 100644 --- a/module/testsuite/model.php +++ b/module/testsuite/model.php @@ -66,14 +66,14 @@ class testsuiteModel extends model * 获取一个产品下的测试套件对。 * Get test suites pairs of a product. * - * @param int $productID + * @param int|array $productID * @access public * @return array */ - public function getSuitePairs(int $productID): array + public function getSuitePairs(int|array $productID): array { return $this->dao->select('id, name')->from(TABLE_TESTSUITE) - ->where('product')->eq($productID) + ->where('product')->in($productID) ->beginIF($this->lang->navGroup->testsuite != 'qa')->andWhere('project')->eq($this->session->project)->fi() ->andWhere('deleted')->eq('0') ->andWhere("(`type` = 'public' OR (`type` = 'private' AND `addedBy` = '{$this->app->user->account}'))") From bcaf98a291ac4edf43a939be79488e3fc72fce09 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Tue, 18 Nov 2025 14:24:14 +0800 Subject: [PATCH 2/3] * [bug#67242,done,1h,0h] Fix testtask cases 2.5menu error. --- module/testtask/control.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index 0c81c9ddd6..4f2fb9739f 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -1243,8 +1243,15 @@ class testtask extends control */ public function ajaxGetDropMenu(int $productID, string $branch, int $taskID, string $module, string $method, string $objectType = '', int $objectID = 0) { - $scope = empty($objectType) ? 'local' : 'all'; - $testtasks = $this->testtask->getProductTasks($productID, $branch, "$scope,totalStatus", '', '', 'id_desc', null); + if($objectType && ($objectType == 'project' || $objectType == 'execution') && $objectID) + { + $testtasks = $objectType == 'project' ? $this->testtask->getProjectTasks($objectID, 0, 'id_desc', null) : $this->testtask->getExecutionTasks($objectID, 0, 'execution', 'id_desc', null); + } + else + { + $scope = empty($objectType) ? 'local' : 'all'; + $testtasks = $this->testtask->getProductTasks($productID, $branch, "$scope,totalStatus", '', '', 'id_desc', null); + } $namePairs = array(); foreach($testtasks as $testtaskID => $testtask) $namePairs[$testtaskID] = $testtask->name; From 456987a653f0fca5f4c9d0fa1bd7fa7aec0ce5cc Mon Sep 17 00:00:00 2001 From: wangyuting Date: Tue, 18 Nov 2025 14:26:59 +0800 Subject: [PATCH 3/3] * Optimize unit test script. --- module/testsuite/test/model/getsuitepairs.php | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/module/testsuite/test/model/getsuitepairs.php b/module/testsuite/test/model/getsuitepairs.php index aaf9f00364..7fa6dc5707 100755 --- a/module/testsuite/test/model/getsuitepairs.php +++ b/module/testsuite/test/model/getsuitepairs.php @@ -11,22 +11,19 @@ su('admin'); /** title=测试 testsuiteModel->getSuitePairs(); +timeout=0 cid=19144 -pid=1 -测试productID值为1,orderBy为id_desc >> 这是测试套件名称1 -测试productID值为1,orderBy为id_asc >> 这是测试套件名称3 -测试productID值为1,orderBy为name_desc,id_desc >> 这是测试套件名称1 -测试productID值为1,orderBy为name_asc,id_desc >> 这是测试套件名称3 -测试productID值为1,orderBy为id_desc >> 0 -测试productID值为1,orderBy为id_asc >> 0 -测试productID值为1,orderBy为name_desc,id_desc >> 0 -测试productID值为1,orderBy为name_asc,id_desc >> 0 - -切换用户dev1 - -测试productID值为1,orderBy为id_desc >> ~~ -测试productID值为1,orderBy为id_desc >> 这是测试套件名称1 +- 测试productID值为1,orderBy为id_desc属性1 @这是测试套件名称1 +- 测试productID值为1,orderBy为id_asc属性3 @这是测试套件名称3 +- 测试productID值为1,orderBy为name_desc,id_desc属性1 @这是测试套件名称1 +- 测试productID值为1,orderBy为name_asc,id_desc属性3 @这是测试套件名称3 +- 测试productID值为1,orderBy为id_desc @0 +- 测试productID值为1,orderBy为id_asc @0 +- 测试productID值为1,orderBy为name_desc,id_desc @0 +- 测试productID值为1,orderBy为name_asc,id_desc @0 +- 测试productID值为1,orderBy为id_desc属性2 @~~ +- 测试productID值为1,orderBy为id_desc属性1 @这是测试套件名称1 */