This commit is contained in:
2024-12-18 11:42:09 +08:00
parent c6b88256e3
commit 654cc483b3
+1 -11
View File
@@ -189,7 +189,7 @@ class SqlBuilder extends Component
if (is_null($value)) {
return $keys;
}
if ($this->isMath($value)) {
if (preg_match('/^[+|-]\s\d+$/', $value)) {
$keys[] = $key . '=' . $key . ' ' . $value;
} else {
$this->query->pushParam($value);
@@ -199,16 +199,6 @@ class SqlBuilder extends Component
}
/**
* @param string $value
* @return bool
*/
private function isMath(string $value): bool
{
return (bool)preg_match('/^[+|-]\s\d+$/', $value);
}
/**
* @return string
* @throws