diff --git a/module/testcase/model.php b/module/testcase/model.php index 4bfb35eb3e..691343577e 100755 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -356,7 +356,7 @@ class testcaseModel extends model $caseQuery .= ')'; /* Search criteria under compatible project. */ - $sql = $this->dao->select('t1.*,t3.title as storyTitle')->from(TABLE_CASE)->alias('t1'); + $sql = $this->dao->select('DISTINCT t1.*,t3.title as storyTitle')->from(TABLE_CASE)->alias('t1'); if($this->app->tab == 'project') $sql->leftJoin(TABLE_PROJECTCASE)->alias('t2')->on('t1.id = t2.case'); $sql->leftJoin(TABLE_STORY)->alias('t3')->on('t1.story = t3.id'); return $sql->where($caseQuery) @@ -367,7 +367,7 @@ class testcaseModel extends model ->beginIF($auto != 'auto' && $auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi() ->andWhere('t1.deleted')->eq('0') ->orderBy($orderBy) - ->page($pager) + ->page($pager, 't1.id') ->fetchAll('id', false); } diff --git a/module/testcase/tao.php b/module/testcase/tao.php index 24b99ff063..1f7e4880a8 100644 --- a/module/testcase/tao.php +++ b/module/testcase/tao.php @@ -63,7 +63,7 @@ class testcaseTao extends testcaseModel */ protected function getModuleProjectCases(int|array $productID, int|string $branch = 0, int|array $moduleIdList = 0, string $browseType = '', string $auto = 'no', string $caseType = '', string $orderBy = 'id_desc', ?object $pager = null): array { - return $this->dao->select('distinct t1.*, t2.*, t4.title AS storyTitle')->from(TABLE_PROJECTCASE)->alias('t1') + return $this->dao->select('DISTINCT t1.product, t1.case, t1.version, t2.*, t4.title AS storyTitle')->from(TABLE_PROJECTCASE)->alias('t1') ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id') ->leftJoin(TABLE_PROJECTSTORY)->alias('t3')->on('t3.story = t2.story') ->leftJoin(TABLE_STORY)->alias('t4')->on('t3.story = t4.id')