From dbb06251e29ac35bf3cfc5503d7f53c2b8d1ceb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=87=91=E5=8B=87?= Date: Wed, 19 Apr 2023 01:10:13 +0000 Subject: [PATCH] * Fix bug#34330. --- module/build/model.php | 6 +++--- module/testcase/model.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/build/model.php b/module/build/model.php index 756f36aca0..493b6383a4 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -253,7 +253,7 @@ class buildModel extends model $buildIdList = str_replace('trunk', '0', $buildIdList); $selectedBuilds = $this->dao->select('id, name')->from(TABLE_BUILD) ->where('id')->in($buildIdList) - ->beginIF($products)->andWhere('product')->in($products)->fi() + ->beginIF($products)->andWhere('product')->in(array_keys($products))->fi() ->beginIF($objectType === 'execution' and $objectID)->andWhere('execution')->eq($objectID)->fi() ->beginIF($objectType === 'project' and $objectID)->andWhere('project')->eq($objectID)->fi() ->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('deleted')->eq(0)->fi() @@ -261,7 +261,7 @@ class buildModel extends model } $branchPairs = $this->dao->select('id,name')->from(TABLE_BRANCH)->fetchPairs(); - $shadows = $this->dao->select('shadow')->from(TABLE_RELEASE)->where('product')->in($products)->fetchPairs('shadow', 'shadow'); + $shadows = $this->dao->select('shadow')->from(TABLE_RELEASE)->where('product')->in(array_keys($products))->fetchPairs('shadow', 'shadow'); $branchs = strpos($params, 'separate') === false ? "0,$branch" : $branch; $allBuilds = $this->dao->select('t1.id, t1.name, t1.branch, t1.execution, t1.date, t1.deleted, t2.status as objectStatus, t3.id as releaseID, t3.status as releaseStatus, t4.type as productType')->from(TABLE_BUILD)->alias('t1') ->beginIF($objectType === 'execution')->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id')->fi() @@ -273,7 +273,7 @@ class buildModel extends model ->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('t1.deleted')->eq(0)->fi() ->beginIF(strpos($params, 'hasproject') !== false)->andWhere('t1.project')->ne(0)->fi() ->beginIF(strpos($params, 'singled') !== false)->andWhere('t1.execution')->ne(0)->fi() - ->beginIF($products)->andWhere('t1.product')->in($products)->fi() + ->beginIF($products)->andWhere('t1.product')->in(array_keys($products))->fi() ->beginIF($objectType === 'execution' and $objectID)->andWhere('t1.execution')->eq($objectID)->fi() ->beginIF($objectType === 'project' and $objectID)->andWhere('t1.project')->eq($objectID)->fi() ->orderBy('t1.date desc, t1.id desc')->fetchAll('id'); diff --git a/module/testcase/model.php b/module/testcase/model.php index a801c1ce90..1466220031 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -2383,7 +2383,7 @@ class testcaseModel extends model else { $caseBugs = $this->dao->select('count(*) as count, `case`')->from(TABLE_BUG)->where('`result`')->in($caseIdList)->andWhere('deleted')->eq(0)->groupBy('`case`')->fetchPairs('case', 'count'); - $results = $this->dao->select('count(*) as count, `case`')->from(TABLE_TESTRESULT)->where('`run`')->in($caseIdList)->groupBy('`run`')->fetchPairs('case', 'count'); + $results = $this->dao->select('count(*) as count, `case`')->from(TABLE_TESTRESULT)->where('`run`')->in($caseIdList)->groupBy('`case`')->fetchPairs('case', 'count'); $caseFails = $this->dao->select('count(*) as count, `case`')->from(TABLE_TESTRESULT) ->where('caseResult')->eq('fail')