From 0622729b7212f501bdf712691105768162442dae Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 6 Jul 2016 11:56:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Mysql=20builder=E9=A9=B1?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/cache/driver/Lite.php | 4 ++-- library/think/db/builder/Mysql.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/think/cache/driver/Lite.php b/library/think/cache/driver/Lite.php index 551359f7..0a3a838b 100644 --- a/library/think/cache/driver/Lite.php +++ b/library/think/cache/driver/Lite.php @@ -36,8 +36,8 @@ class Lite if (!empty($options)) { $this->options = array_merge($this->options, $options); } - if (substr($this->options['path'], -1) != '/') { - $this->options['path'] .= '/'; + if (substr($this->options['path'], -1) != DS) { + $this->options['path'] .= DS; } } diff --git a/library/think/db/builder/Mysql.php b/library/think/db/builder/Mysql.php index d7427af7..84853307 100644 --- a/library/think/db/builder/Mysql.php +++ b/library/think/db/builder/Mysql.php @@ -31,7 +31,7 @@ class Mysql extends Builder $key = trim($key); if (strpos($key, '$.') && false === strpos($key, '(')) { // JSON字段支持 - list($field, $name) = explode($key, '$.'); + list($field, $name) = explode('$.', $key); $key = 'jsn_extract(' . $field . ', \'$.\'.' . $name . ')'; } if (!preg_match('/[,\'\"\*\(\)`.\s]/', $key)) {