改名
This commit is contained in:
@@ -168,7 +168,6 @@ class Command extends Component
|
|||||||
{
|
{
|
||||||
$pdo = $this->db->getConnect($this->sql);
|
$pdo = $this->db->getConnect($this->sql);
|
||||||
$result = $pdo->execute($this->sql, $isInsert, $this->params);
|
$result = $pdo->execute($this->sql, $isInsert, $this->params);
|
||||||
var_dump($result);
|
|
||||||
if ($hasAutoIncrement && $result == 0) {
|
if ($hasAutoIncrement && $result == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-4
@@ -149,7 +149,11 @@ class PDO implements StopHeartbeatCheck
|
|||||||
*/
|
*/
|
||||||
public function fetchAll(string $sql, array $params = []): array
|
public function fetchAll(string $sql, array $params = []): array
|
||||||
{
|
{
|
||||||
return $this->queryPrev($sql, $params)->fetchAll(\PDO::FETCH_ASSOC);
|
$pdo = $this->queryPrev($sql, $params);
|
||||||
|
|
||||||
|
defer(fn() => $pdo->closeCursor());
|
||||||
|
|
||||||
|
return $pdo->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -161,7 +165,11 @@ class PDO implements StopHeartbeatCheck
|
|||||||
*/
|
*/
|
||||||
public function fetch(string $sql, array $params = []): array
|
public function fetch(string $sql, array $params = []): array
|
||||||
{
|
{
|
||||||
return $this->queryPrev($sql, $params)->fetch(\PDO::FETCH_ASSOC);
|
$pdo = $this->queryPrev($sql, $params);
|
||||||
|
|
||||||
|
defer(fn() => $pdo->closeCursor());
|
||||||
|
|
||||||
|
return $pdo->fetch(\PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -173,7 +181,11 @@ class PDO implements StopHeartbeatCheck
|
|||||||
*/
|
*/
|
||||||
public function fetchColumn(string $sql, array $params = []): array
|
public function fetchColumn(string $sql, array $params = []): array
|
||||||
{
|
{
|
||||||
return $this->queryPrev($sql, $params)->fetchColumn(\PDO::FETCH_ASSOC);
|
$pdo = $this->queryPrev($sql, $params);
|
||||||
|
|
||||||
|
defer(fn() => $pdo->closeCursor());
|
||||||
|
|
||||||
|
return $pdo->fetchColumn(\PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -185,7 +197,11 @@ class PDO implements StopHeartbeatCheck
|
|||||||
*/
|
*/
|
||||||
public function count(string $sql, array $params = []): int
|
public function count(string $sql, array $params = []): int
|
||||||
{
|
{
|
||||||
return $this->queryPrev($sql, $params)->rowCount();
|
$pdo = $this->queryPrev($sql, $params);
|
||||||
|
|
||||||
|
defer(fn() => $pdo->closeCursor());
|
||||||
|
|
||||||
|
return $pdo->rowCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user