From 202852a95d05132e90244baf875441c8a8e56b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 20 Sep 2022 18:34:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Connection.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Connection.php b/Connection.php index 8ec87df..2d31ec7 100644 --- a/Connection.php +++ b/Connection.php @@ -264,9 +264,7 @@ class Connection extends Component { $connections = $this->connection; $cds = ($this->slaveConfig['cds'] ?? $this->cds) . ($isMaster ? 'master' : 'slave'); - if (!$isMaster) { - $connections->addItem($cds, $pdo); - } else if (!$pdo->inTransaction()) { + if (!$pdo->inTransaction()) { $connections->addItem($cds, $pdo); } }