From 7cf28a3aaa1f89974393c9f4121e8f9c10e28a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 18 Jan 2022 18:07:58 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E6=94=B9=E5=90=8D"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fdf58326 --- Model.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Model.php b/Model.php index af45a30..c34c0eb 100644 --- a/Model.php +++ b/Model.php @@ -142,7 +142,6 @@ class Model extends Base\Model return $logger->addError(FIND_OR_CREATE_MESSAGE, 'mysql'); } - Db::beginTransaction(); /** @var static $select */ $select = static::query()->where($condition)->first(); if (empty($select)) { @@ -150,10 +149,7 @@ class Model extends Base\Model } $select->attributes = $attributes; if (!$select->save()) { - Db::rollback(); $select = $logger->addError($select->getLastError(), 'mysql'); - } else { - Db::commit(); } return $select; }