modify
This commit is contained in:
@@ -196,14 +196,22 @@ class Command extends Component
|
||||
|
||||
return $this->addError($this->sql . ':' . $error, 'mysql');
|
||||
}
|
||||
$result = $this->checkResponse($prepare, $connect);
|
||||
$prepare->closeCursor();
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
private function checkResponse($prepare, $connect)
|
||||
{
|
||||
$result = $prepare->execute($this->params);
|
||||
defer(fn() => $prepare->closeCursor());
|
||||
if ($result === false) {
|
||||
return $this->addError($connect->errorInfo()[2], 'mysql');
|
||||
}
|
||||
return (int)$connect->lastInsertId();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $modelName
|
||||
* @return $this
|
||||
|
||||
Reference in New Issue
Block a user