From 9db0007e36695db6c958b66525d8df2b75ca5567 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 31 Oct 2017 12:12:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E5=8F=82=E6=95=B0=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E7=B1=BB=E5=9E=8B=E5=AF=B9=E6=9E=9A=E4=B8=BE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 6b85aba3..872bb639 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1818,7 +1818,9 @@ class Query */ protected function getFieldBindType($type) { - if (preg_match('/(int|double|float|decimal|real|numeric|serial|bit)/is', $type)) { + if (0 === strpos($type, 'set') || 0 === strpos($type, 'enum')) { + $bind = PDO::PARAM_STR; + } elseif (preg_match('/(int|double|float|decimal|real|numeric|serial|bit)/is', $type)) { $bind = PDO::PARAM_INT; } elseif (preg_match('/bool/is', $type)) { $bind = PDO::PARAM_BOOL;