From 561bf3cbf3f3e6c4e93cae3edbeba4bd67d036ca Mon Sep 17 00:00:00 2001 From: liugang Date: Fri, 11 Aug 2023 16:04:35 +0800 Subject: [PATCH] * testcase: refactor the batchDelete method. --- module/testcase/control.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index d8d7dbae94..ff37560606 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1407,13 +1407,15 @@ class testcase extends control foreach($caseIDList as $caseID) { - $vs = $this->dao->findById((int)$caseID)->from(VIEW_SCENECASE)->fetch(); - if($vs->isCase == 2) + if(strpos($caseID, 'scene_') !== false) { - $this->testcase->delete(TABLE_SCENE, $caseID-CHANGEVALUE); + $caseID = str_replace('scene_', '', $caseID); + $this->testcase->delete(TABLE_SCENE, $caseID); } - else + + if(strpos($caseID, 'case_') !== false) { + $caseID = str_replace('case_', '', $caseID); $this->testcase->delete(TABLE_CASE, $caseID); } }