From ff81a854d97af79ddbc5303771befb1bf3b811d9 Mon Sep 17 00:00:00 2001 From: liugang Date: Tue, 15 Aug 2023 16:34:42 +0800 Subject: [PATCH] * testcaseModel: fix error of batch review cases. --- module/testcase/model.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/module/testcase/model.php b/module/testcase/model.php index 55555e401b..061b131d9b 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1063,14 +1063,10 @@ class testcaseModel extends model */ public function batchReview($caseIDList, $result) { - $caseIDList = $this->filterIdList($caseIDList); + $caseIDList = array_filter($caseIDList); if(!$caseIDList) return false; - $oldCases = $this->getByList($caseIDList, 'status = wait'); - $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->where('status')->eq('wait')->andWhere('id')->in($caseIDList)->exec(); - if(dao::isError()) return false; - - $this->loadModel('action'); + $oldCases = $this->getByList($caseIDList, "status = 'wait'"); $now = helper::now(); $case = new stdClass(); @@ -1080,6 +1076,11 @@ class testcaseModel extends model $case->lastEditedDate = $now; if($result == 'pass') $case->status = 'normal'; + $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->where('status')->eq('wait')->andWhere('id')->in($caseIDList)->exec(); + if(dao::isError()) return false; + + $this->loadModel('action'); + foreach($oldCases as $oldCase) { $changes = common::createChanges($oldCase, $case);