From 4f6952bdc5843fc96315e162f3e2fb2984542f02 Mon Sep 17 00:00:00 2001 From: xl Date: Tue, 2 May 2023 15:43:20 +0800 Subject: [PATCH] r --- Base/Model.php | 3 +-- Command.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Base/Model.php b/Base/Model.php index e6bf1c0..36bf99c 100644 --- a/Base/Model.php +++ b/Base/Model.php @@ -180,8 +180,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T */ public function getLastError(): string { - $logger = Kiri::getDi()->get(LoggerInterface::class); - return $logger->getLastError('mysql'); + return Kiri::getLogger()->getLastError('mysql'); } diff --git a/Command.php b/Command.php index beb2302..253705f 100644 --- a/Command.php +++ b/Command.php @@ -193,7 +193,7 @@ class Command extends Component if (!$client->inTransaction()) { $this->connection->release($client); } - return $result == 0 ? true : $result; + return $result == 0 ? true : (int)$result; } catch (Throwable $throwable) { if (str_contains($throwable->getMessage(), 'MySQL server has gone away')) { return $this->_execute();