From e643514af815123399424be3cdc9404b25c5d364 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 15 Nov 2016 18:53:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=85=B3=E8=81=94=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=9A=84=E6=97=B6=E5=80=99=20whereTime=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Builder.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/think/db/Builder.php b/library/think/db/Builder.php index 69484ffe..c963a704 100644 --- a/library/think/db/Builder.php +++ b/library/think/db/Builder.php @@ -397,7 +397,15 @@ abstract class Builder protected function parseDateTime($value, $key, $options = [], $bindName = null, $bindType = null) { // 获取时间字段类型 - $type = $this->query->getFieldsType($options); + if (strpos($key, '.')) { + list($table, $key) = explode('.', $key); + if (isset($options['alias']) && $pos = array_search($table, $options['alias'])) { + $table = $pos; + } + } else { + $table = $options['table']; + } + $type = $this->query->getTableInfo($table, 'type'); if (isset($type[$key])) { $info = $type[$key]; }