改名
This commit is contained in:
+6
-2
@@ -222,11 +222,12 @@ class PDO implements StopHeartbeatCheck
|
||||
|
||||
/**
|
||||
* @param string $sql
|
||||
* @param $isInsert
|
||||
* @param array $params
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public function execute(string $sql, array $params = []): int
|
||||
public function execute(string $sql, $isInsert, array $params = []): int
|
||||
{
|
||||
$this->_last = time();
|
||||
if (!(($prepare = $this->_pdo()->prepare($sql)) instanceof PDOStatement)) {
|
||||
@@ -236,7 +237,10 @@ class PDO implements StopHeartbeatCheck
|
||||
if ($prepare->execute($params) === false) {
|
||||
throw new Exception($prepare->errorInfo()[2] ?? static::DB_ERROR_MESSAGE);
|
||||
}
|
||||
return (int)$this->_pdo()->lastInsertId();
|
||||
if (!$isInsert) {
|
||||
return (int)$this->_pdo()->lastInsertId();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user