From 84568c504a68d62f96219970bfffd446b7fa1ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 25 Apr 2023 17:05:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SqlBuilder.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/SqlBuilder.php b/SqlBuilder.php index 6813e46..c33fbcd 100644 --- a/SqlBuilder.php +++ b/SqlBuilder.php @@ -186,10 +186,8 @@ class SqlBuilder extends Component if (is_null($value)) { return $keys; } - if ( - str_starts_with($value, '+ ') || - str_starts_with($value, '- ') - ) { + if (is_string($value) && (str_starts_with($value, '+ ') || + str_starts_with($value, '- '))) { $keys[] = $key . '=' . $key . ' ' . $value; } else { $this->query->bindParam(':update' . $key . $order, $value);