modify plugin name

This commit is contained in:
2022-06-08 15:13:53 +08:00
parent a5dde8a140
commit eb36a30b26
+4 -8
View File
@@ -137,15 +137,13 @@ class Command extends Component
*/
private function _execute(): bool|int
{
$pdo = $this->db->masterInstance();
try {
$pdo = $this->db->masterInstance();
$result = $pdo->execute($this->sql, $this->params);
$this->db->release($pdo, true);
} catch (\Throwable $exception) {
$result = $this->logger->addError($this->sql . '. error: ' . $exception->getMessage(), 'mysql');
} finally {
$this->db->release($pdo, true);
return $result;
}
}
@@ -158,15 +156,13 @@ class Command extends Component
*/
private function search(string $type): array|int|bool|null
{
$pdo = $this->db->slaveInstance();
try {
$pdo = $this->db->slaveInstance();
$data = $pdo->{$type}($this->sql, $this->params);
$this->db->release($pdo, false);
} catch (\Throwable $throwable) {
$data = $this->logger->addError($this->sql . '. error: ' . $throwable->getMessage(), 'mysql');
} finally {
$this->db->release($pdo, false);
return $data;
}
}