From 63a1322025c17311f9f1674698c69d087cadfb01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 18 Jan 2022 18:07:35 +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 ef316d4..af45a30 100644 --- a/Model.php +++ b/Model.php @@ -112,7 +112,6 @@ class Model extends Base\Model if (empty($attributes)) { return $logger->addError(FIND_OR_CREATE_MESSAGE, 'mysql'); } - Db::beginTransaction(); try { /** @var static $select */ $select = static::query()->where($condition)->first(); @@ -123,11 +122,8 @@ class Model extends Base\Model throw new Exception($select->getLastError()); } } - Db::commit(); - return $select; } catch (\Throwable $throwable) { - Db::rollback(); return $logger->addError($throwable->getMessage(), 'mysql'); } }