From ea1b1af3a33aaf13ec0adb6fb2447a39c32f1d98 Mon Sep 17 00:00:00 2001 From: yunwuxin <448901948@qq.com> Date: Wed, 15 Jun 2016 11:10:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=8B=E5=8A=A1=E5=B5=8C?= =?UTF-8?q?=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 10 ++++------ library/think/model/Merge.php | 8 ++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 566d5446..7082370a 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -239,24 +239,22 @@ class Query /** * 启动事务 * @access public - * @param string $label 事务标识 * @return bool|null */ - public function startTrans($label = '') + public function startTrans() { - return $this->connection->startTrans($label); + return $this->connection->startTrans(); } /** * 用于非自动提交状态下面的查询提交 * @access public - * @param string $label 事务标识 * @return boolean * @throws PDOException */ - public function commit($label = '') + public function commit() { - return $this->connection->commit($label); + return $this->connection->commit(); } /** diff --git a/library/think/model/Merge.php b/library/think/model/Merge.php index 5672ebc0..3da4fc07 100644 --- a/library/think/model/Merge.php +++ b/library/think/model/Merge.php @@ -173,7 +173,7 @@ class Merge extends Model } $db = $this->db(); - $db->startTrans('merge_save_' . $this->name); + $db->startTrans(); try { if ($this->isUpdate) { // 自动写入 @@ -235,7 +235,7 @@ class Merge extends Model // 新增回调 $this->trigger('after_insert', $this); } - $db->commit('merge_save_' . $this->name); + $db->commit(); return $result; } catch (\PDOException $e) { $db->rollback(); @@ -255,7 +255,7 @@ class Merge extends Model } $db = $this->db(); - $db->startTrans('merge_delete_' . $this->name); + $db->startTrans(); try { $result = $db->delete($this->data); if ($result) { @@ -270,7 +270,7 @@ class Merge extends Model } } $this->trigger('after_delete', $this); - $db->commit('merge_delete_' . $this->name); + $db->commit(); return $result; } catch (\PDOException $e) { $db->rollback();