From 7466c2dbd77416697994e3175c093df919ba2c87 Mon Sep 17 00:00:00 2001 From: Lufei Date: Tue, 16 May 2023 10:55:32 +0800 Subject: [PATCH] * Fix testcase getList param error. --- module/testcase/control.php | 6 +++--- module/testcase/model.php | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 10e6c7bcb9..6300112254 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -164,15 +164,15 @@ class testcase extends control } $queryCondition = ''; - $topObjects = $this->testcase->getList($productParam,$branch, $moduleID, $caseIdList, $pager, 'top', array(), $browseType); + $topObjects = $this->testcase->getList($productParam,$branch, $moduleID, $caseIdList, $pager, 'top', array(), $browseType); /* Get children cases and scenes.*/ $scenes = $this->testcase->getList($productParam, $branch,$moduleID, $caseIdList, null, 'child', array_keys($topObjects), $browseType, $queryCondition); if(empty($topObjects) and $pageID > 1) { $pager = pager::init(0, $recPerPage, 1); - $topObjects = $this->testcase->getList($productParam,$branch, $moduleID, $caseIdList, $pager,'top',array(),$browseType); - $scenes = $this->testcase->getList($productParam,$branch, $moduleID, $caseIdList, null, 'child', array_keys($topObjects),$browseType, $queryCondition); + $topObjects = $this->testcase->getList($productParam, $branch, $moduleID, $caseIdList, $pager, 'top', array(),$browseType); + $scenes = $this->testcase->getList($productParam, $branch, $moduleID, $caseIdList, null, 'child', array_keys($topObjects), $browseType, $queryCondition); } /* save session .*/ diff --git a/module/testcase/model.php b/module/testcase/model.php index dcde0fe608..37f51a8a8c 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -3443,14 +3443,15 @@ class testcaseModel extends model * @param string $branch number|all * @param int $moduleID * @param array $caseIdArr - * @param object $pager object|NULL + * @param object $pager object|null * @param string $type * @param array $topIdList * @param string $browseType + * @param string $executionSql * @access public * @return array */ - public function getList($productID,$branch, $moduleID, $caseIdArr, $pager = NULL, $type = '', $topIdList = array(), $browseType, &$executionSql = NULL) + public function getList($productID,$branch, $moduleID, $caseIdArr, $pager = null, $type = '', $topIdList = array(), $browseType = '', &$executionSql = null) { /* Get list of module and its children module. */ $modules = $moduleID ? $this->loadModel('tree')->getAllChildId($moduleID) : '0'; @@ -3504,7 +3505,7 @@ class testcaseModel extends model $orderBy = 'product_desc,sort_asc'; /* Get sql for batch execution. */ - if($executionSql !== NULL) $executionSql = $this->buildQuery($modules, $type, $objectIdList, $branch)->andWhere('isCase')->eq(1)->orderBy($orderBy)->get(); + if($executionSql !== null) $executionSql = $this->buildQuery($modules, $type, $objectIdList, $branch)->andWhere('isCase')->eq(1)->orderBy($orderBy)->get(); return $this->buildQuery($modules, $type, $objectIdList, $branch)->orderBy($orderBy)->page($pager)->fetchAll('id'); } @@ -3512,10 +3513,10 @@ class testcaseModel extends model /** * Get paginated data with all IDs list. * - * @param string $modules - * @param string $type - * @param string $objectIdList - * @param string $branch + * @param string $modules + * @param string $type + * @param string|array $objectIdList + * @param string $branch * @access public * @return object */