From c6b88256e35b2b1334266d87fa1a066ed2ccbf69 Mon Sep 17 00:00:00 2001 From: whwyy Date: Wed, 18 Dec 2024 11:31:15 +0800 Subject: [PATCH] eee --- SqlBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SqlBuilder.php b/SqlBuilder.php index 2861d39..dc4885a 100644 --- a/SqlBuilder.php +++ b/SqlBuilder.php @@ -189,7 +189,7 @@ class SqlBuilder extends Component if (is_null($value)) { return $keys; } - if (is_string($value) && $this->isMath($value)) { + if ($this->isMath($value)) { $keys[] = $key . '=' . $key . ' ' . $value; } else { $this->query->pushParam($value); @@ -205,7 +205,7 @@ class SqlBuilder extends Component */ private function isMath(string $value): bool { - return str_starts_with($value, '+ ') || str_starts_with($value, '- '); + return (bool)preg_match('/^[+|-]\s\d+$/', $value); }