modify plugin name
This commit is contained in:
+4
-8
@@ -137,15 +137,13 @@ class Command extends Component
|
|||||||
*/
|
*/
|
||||||
private function _execute(): bool|int
|
private function _execute(): bool|int
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$pdo = $this->db->masterInstance();
|
$pdo = $this->db->masterInstance();
|
||||||
|
try {
|
||||||
$result = $pdo->execute($this->sql, $this->params);
|
$result = $pdo->execute($this->sql, $this->params);
|
||||||
|
|
||||||
$this->db->release($pdo, true);
|
|
||||||
} catch (\Throwable $exception) {
|
} catch (\Throwable $exception) {
|
||||||
$result = $this->logger->addError($this->sql . '. error: ' . $exception->getMessage(), 'mysql');
|
$result = $this->logger->addError($this->sql . '. error: ' . $exception->getMessage(), 'mysql');
|
||||||
} finally {
|
} finally {
|
||||||
|
$this->db->release($pdo, true);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -158,15 +156,13 @@ class Command extends Component
|
|||||||
*/
|
*/
|
||||||
private function search(string $type): array|int|bool|null
|
private function search(string $type): array|int|bool|null
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$pdo = $this->db->slaveInstance();
|
$pdo = $this->db->slaveInstance();
|
||||||
|
try {
|
||||||
$data = $pdo->{$type}($this->sql, $this->params);
|
$data = $pdo->{$type}($this->sql, $this->params);
|
||||||
|
|
||||||
$this->db->release($pdo, false);
|
|
||||||
} catch (\Throwable $throwable) {
|
} catch (\Throwable $throwable) {
|
||||||
$data = $this->logger->addError($this->sql . '. error: ' . $throwable->getMessage(), 'mysql');
|
$data = $this->logger->addError($this->sql . '. error: ' . $throwable->getMessage(), 'mysql');
|
||||||
} finally {
|
} finally {
|
||||||
|
$this->db->release($pdo, false);
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user