From e1abc0844b7cb9a473842d198d316e2401387e29 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 20 May 2016 23:53:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BBuilder=E7=B1=BB=E5=AF=B9fiel?= =?UTF-8?q?d=E5=AD=97=E7=AC=A6=E4=B8=B2=E7=9A=84=E7=A9=BA=E6=A0=BC?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Builder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/db/Builder.php b/library/think/db/Builder.php index 23a5c8f4..8a10e2c8 100644 --- a/library/think/db/Builder.php +++ b/library/think/db/Builder.php @@ -85,7 +85,7 @@ abstract class Builder if ('*' == $options['field']) { $fields = array_keys($bind); } else { - $fields = is_array($options['field']) ? $options['field'] : explode(',', $options['field']); + $fields = is_array($options['field']) ? $options['field'] : array_map('trim', explode(',', $options['field'])); } $result = []; @@ -567,7 +567,7 @@ abstract class Builder if ('*' == $options['field']) { $fields = $this->query->getTableInfo($options['table'], 'fields'); } else { - $fields = is_array($options['field']) ? $options['field'] : explode(',', $options['field']); + $fields = is_array($options['field']) ? $options['field'] : array_map('trim', explode(',', $options['field'])); } foreach ($dataSet as &$data) {