modify plugin name
This commit is contained in:
+4
-8
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user