This commit is contained in:
2023-12-06 18:24:53 +08:00
parent 641187e240
commit 0b782de1f1
+6 -1
View File
@@ -132,11 +132,16 @@ class Command extends Component
private function _execute(): bool|int
{
try {
/** @var PDO $client */
[$client, $prepare] = $this->_prepare();
$result = $client->lastInsertId();
$prepare->closeCursor();
$this->connection->release($client);
return $result == 0 ? $prepare->rowCount() > 0 : (int)$result;
if ($result == 0) {
return $prepare->rowCount() > 0;
} else {
return (int)$result;
}
} catch (Throwable $throwable) {
if ($this->isRefresh($throwable)) {
return $this->_execute();