改名
This commit is contained in:
+16
-15
@@ -153,9 +153,9 @@ class PDO implements StopHeartbeatCheck
|
|||||||
{
|
{
|
||||||
$pdo = $this->queryPrev($sql, $params);
|
$pdo = $this->queryPrev($sql, $params);
|
||||||
|
|
||||||
defer(fn() => $pdo->closeCursor());
|
$result = $pdo->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
|
$pdo->closeCursor();
|
||||||
return $pdo->fetchAll(\PDO::FETCH_ASSOC);
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -169,9 +169,9 @@ class PDO implements StopHeartbeatCheck
|
|||||||
{
|
{
|
||||||
$pdo = $this->queryPrev($sql, $params);
|
$pdo = $this->queryPrev($sql, $params);
|
||||||
|
|
||||||
defer(fn() => $pdo->closeCursor());
|
$result = $pdo->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
$pdo->closeCursor();
|
||||||
return $pdo->fetch(\PDO::FETCH_ASSOC);
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -185,9 +185,9 @@ class PDO implements StopHeartbeatCheck
|
|||||||
{
|
{
|
||||||
$pdo = $this->queryPrev($sql, $params);
|
$pdo = $this->queryPrev($sql, $params);
|
||||||
|
|
||||||
defer(fn() => $pdo->closeCursor());
|
$result = $pdo->fetchColumn(\PDO::FETCH_ASSOC);
|
||||||
|
$pdo->closeCursor();
|
||||||
return $pdo->fetchColumn(\PDO::FETCH_ASSOC);
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -201,9 +201,9 @@ class PDO implements StopHeartbeatCheck
|
|||||||
{
|
{
|
||||||
$pdo = $this->queryPrev($sql, $params);
|
$pdo = $this->queryPrev($sql, $params);
|
||||||
|
|
||||||
defer(fn() => $pdo->closeCursor());
|
$result = $pdo->rowCount();
|
||||||
|
$pdo->closeCursor();
|
||||||
return $pdo->rowCount();
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -251,14 +251,15 @@ class PDO implements StopHeartbeatCheck
|
|||||||
if (!(($prepare = $this->_pdo()->prepare($sql)) instanceof PDOStatement)) {
|
if (!(($prepare = $this->_pdo()->prepare($sql)) instanceof PDOStatement)) {
|
||||||
throw new Exception($prepare->errorInfo()[2] ?? static::DB_ERROR_MESSAGE);
|
throw new Exception($prepare->errorInfo()[2] ?? static::DB_ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
defer(fn() => $prepare->closeCursor());
|
|
||||||
if ($prepare->execute($params) === false) {
|
if ($prepare->execute($params) === false) {
|
||||||
throw new Exception($prepare->errorInfo()[2] ?? static::DB_ERROR_MESSAGE);
|
throw new Exception($prepare->errorInfo()[2] ?? static::DB_ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
|
$result = 1;
|
||||||
if ($isInsert) {
|
if ($isInsert) {
|
||||||
return (int)$this->_pdo()->lastInsertId();
|
$result = (int)$this->_pdo()->lastInsertId();
|
||||||
}
|
}
|
||||||
return 1;
|
$prepare->closeCursor();
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user