From db18a2d73ad31a21c7f9ee13a8e3a5ac81def3e0 Mon Sep 17 00:00:00 2001 From: whwyy Date: Sun, 11 Jan 2026 19:55:00 +0800 Subject: [PATCH] eee --- ActiveQuery.php | 2 +- Command.php | 31 +------------------------------ 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/ActiveQuery.php b/ActiveQuery.php index 2cd7465..b431e99 100644 --- a/ActiveQuery.php +++ b/ActiveQuery.php @@ -288,6 +288,6 @@ class ActiveQuery extends QueryTrait implements ISqlBuilder */ public function delete(): bool { - return $this->buildCommand($this->builder->delete())->exec(); + return (bool)$this->buildCommand($this->builder->delete())->exec(); } } diff --git a/Command.php b/Command.php index f02e3c8..8060469 100644 --- a/Command.php +++ b/Command.php @@ -229,36 +229,7 @@ class Command extends Component */ public function delete(): bool { - $client = $this->connection->getConnection(); - try { - $startTime = microtime(true); - if (($prepare = $client->prepare($this->sql)) === false) { - throw new Exception('(' . $prepare->errorInfo()[0] . ')' . $prepare->errorInfo()[2]); - } - - $execute = $prepare->execute($this->params); - var_dump($execute); - if ($execute === false) { - throw new Exception('(' . $prepare->errorInfo()[0] . ')' . $prepare->errorInfo()[2]); - } - $prepare->closeCursor(); - - $this->connection->println($startTime, microtime(true), $this->sql, $this->params); - - return true; - } catch (Throwable $throwable) { - $this->getLogger()->json_log($throwable); - - if ($this->isRefresh($throwable)) { - return $this->_prepare(); - } - - $errorMsg = $throwable->getMessage() . PHP_EOL . ' Sql: ' . $this->sql . '.' . json_encode($this->params, JSON_UNESCAPED_UNICODE); - - return $this->getLogger()->logCategory($errorMsg . PHP_EOL, 'mysql'); - } finally { - $this->connection->release($client); - } + return $this->_prepare(); }