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();