eee
This commit is contained in:
+2
-2
@@ -189,7 +189,7 @@ class SqlBuilder extends Component
|
|||||||
if (is_null($value)) {
|
if (is_null($value)) {
|
||||||
return $keys;
|
return $keys;
|
||||||
}
|
}
|
||||||
if (is_string($value) && $this->isMath($value)) {
|
if ($this->isMath($value)) {
|
||||||
$keys[] = $key . '=' . $key . ' ' . $value;
|
$keys[] = $key . '=' . $key . ' ' . $value;
|
||||||
} else {
|
} else {
|
||||||
$this->query->pushParam($value);
|
$this->query->pushParam($value);
|
||||||
@@ -205,7 +205,7 @@ class SqlBuilder extends Component
|
|||||||
*/
|
*/
|
||||||
private function isMath(string $value): bool
|
private function isMath(string $value): bool
|
||||||
{
|
{
|
||||||
return str_starts_with($value, '+ ') || str_starts_with($value, '- ');
|
return (bool)preg_match('/^[+|-]\s\d+$/', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user