From abec2ffbff77e72f79d38d973fa20d8e679736c6 Mon Sep 17 00:00:00 2001 From: whwyy Date: Tue, 7 Jul 2026 02:06:57 +0800 Subject: [PATCH] eee --- SqlBuilder.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SqlBuilder.php b/SqlBuilder.php index 57471da..a95b45b 100644 --- a/SqlBuilder.php +++ b/SqlBuilder.php @@ -108,7 +108,6 @@ class SqlBuilder extends Component */ private function __updateBuilder(array $string): string|bool { - var_dump('UPDATE ' . $this->getFromAlias() . ' ' . 'SET' . ' ' . implode(', ', $string) . ' ' . $this->make(), $string); if (empty($string)) { return Kiri::getLogger()->logCategory('None data update.'); } @@ -125,7 +124,7 @@ class SqlBuilder extends Component */ public function insert(array $attributes, bool $isBatch = false): string { - $update = 'INSERT INTO ' . $this->getFromAlias(); + $update = 'INSERT INTO ' . $this->getFromAlias(true); if ($isBatch === false) { $attributes = [$attributes]; } @@ -457,9 +456,13 @@ class SqlBuilder extends Component * QueryTrait 对象有 $from 和 $alias 属性 * @return string */ - private function getFromAlias(): string + private function getFromAlias(bool $insert = false): string { $from = $this->query->from; + if ($insert) { + return ''; + } + if ($this->query->alias !== '' && $this->query->alias !== '0') { $from .= ' AS ' . $this->query->alias; }