From 5d2892e415aa1653a8db20dc4bc1e5f7a272ba20 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 13 Jan 2022 05:22:04 +0000 Subject: [PATCH] * Modify actionID return. --- module/pipeline/model.php | 5 +++-- module/sonarqube/control.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/pipeline/model.php b/module/pipeline/model.php index 5fbe19c650..458811ee5e 100644 --- a/module/pipeline/model.php +++ b/module/pipeline/model.php @@ -129,13 +129,14 @@ class pipelineModel extends model * @param string $id the id to be deleted * @param string $object the action object * @access public - * @return bool + * @return int */ public function delete($id, $object = 'gitlab') { $this->dao->update(TABLE_PIPELINE)->set('deleted')->eq(1)->where('id')->eq($id)->exec(); $this->loadModel('action')->create($object, $id, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); - return true; + $actionID = $this->dao->lastInsertID(); + return $actionID; } } diff --git a/module/sonarqube/control.php b/module/sonarqube/control.php index d525c4cbb4..9d9a69c83f 100644 --- a/module/sonarqube/control.php +++ b/module/sonarqube/control.php @@ -114,7 +114,7 @@ class sonarqube extends control $oldSonarQube = $this->sonarqube->getByID($sonarqubeID); $this->loadModel('action'); - $this->loadModel('pipeline')->delete($sonarqubeID, 'sonarqube'); + $actionID = $this->loadModel('pipeline')->delete($sonarqubeID, 'sonarqube'); $sonarQube = $this->sonarqube->getByID($sonarqubeID); $changes = common::createChanges($oldSonarQube, $sonarQube);