* Fix testcase getList param error.

This commit is contained in:
Lufei
2023-05-16 10:55:32 +08:00
parent 2a05766fe2
commit 7466c2dbd7
2 changed files with 11 additions and 10 deletions
+3 -3
View File
@@ -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 .*/
+8 -7
View File
@@ -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
*/