From 77c1f9c8bf3929eea15e5dfc2c75c93b9dba358d Mon Sep 17 00:00:00 2001 From: molong Date: Wed, 4 Jan 2017 19:51:59 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=86=85=E6=A0=B8=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=202=E3=80=81=E5=8F=AF=E5=85=B3=E9=97=AD=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/controller/Fornt.php | 2 +- core/base.php | 2 +- core/helper.php | 2 +- core/lang/zh-cn.php | 2 +- core/library/think/App.php | 2 +- core/library/think/Build.php | 2 +- core/library/think/Cache.php | 2 +- core/library/think/Collection.php | 2 +- core/library/think/Config.php | 2 +- core/library/think/Controller.php | 2 +- core/library/think/Cookie.php | 2 +- core/library/think/Db.php | 2 +- core/library/think/Debug.php | 2 +- core/library/think/Env.php | 2 +- core/library/think/Error.php | 2 +- core/library/think/Exception.php | 2 +- core/library/think/File.php | 2 +- core/library/think/Hook.php | 2 +- core/library/think/Lang.php | 2 +- core/library/think/Loader.php | 2 +- core/library/think/Log.php | 2 +- core/library/think/Model.php | 6 +- core/library/think/Paginator.php | 2 +- core/library/think/Request.php | 21 ++++- core/library/think/Response.php | 2 +- core/library/think/Route.php | 6 +- core/library/think/Session.php | 2 +- core/library/think/Template.php | 2 +- core/library/think/Url.php | 2 +- core/library/think/Validate.php | 4 +- core/library/think/View.php | 2 +- core/library/think/cache/Driver.php | 2 +- core/library/think/cache/driver/File.php | 2 +- core/library/think/cache/driver/Lite.php | 2 +- core/library/think/cache/driver/Memcache.php | 2 +- core/library/think/cache/driver/Memcached.php | 2 +- core/library/think/cache/driver/Redis.php | 2 +- core/library/think/cache/driver/Sqlite.php | 2 +- core/library/think/cache/driver/Wincache.php | 2 +- core/library/think/cache/driver/Xcache.php | 2 +- core/library/think/config/driver/Ini.php | 2 +- core/library/think/config/driver/Json.php | 2 +- core/library/think/config/driver/Xml.php | 2 +- core/library/think/controller/Rest.php | 2 +- core/library/think/db/Builder.php | 14 ++- core/library/think/db/Connection.php | 18 ++-- core/library/think/db/Query.php | 90 +++++++++++++++++-- core/library/think/db/builder/Mysql.php | 2 +- core/library/think/db/builder/Pgsql.php | 2 +- core/library/think/db/builder/Sqlite.php | 2 +- core/library/think/db/connector/Mysql.php | 11 ++- core/library/think/db/connector/Pgsql.php | 2 +- core/library/think/db/connector/Sqlite.php | 2 +- .../think/db/exception/BindParamException.php | 2 +- .../db/exception/DataNotFoundException.php | 2 +- .../db/exception/ModelNotFoundException.php | 2 +- core/library/think/exception/DbException.php | 2 +- .../think/exception/ErrorException.php | 2 +- core/library/think/exception/PDOException.php | 2 +- core/library/think/model/Merge.php | 2 +- core/library/think/model/Pivot.php | 2 +- core/library/think/model/Relation.php | 13 ++- .../think/model/relation/BelongsTo.php | 2 +- .../think/model/relation/BelongsToMany.php | 2 +- core/library/think/model/relation/HasMany.php | 2 +- .../think/model/relation/HasManyThrough.php | 2 +- core/library/think/model/relation/HasOne.php | 2 +- .../think/model/relation/MorphMany.php | 2 +- core/library/think/model/relation/MorphTo.php | 2 +- .../library/think/model/relation/OneToOne.php | 3 +- core/library/think/paginator/Collection.php | 2 +- .../think/paginator/driver/Bootstrap.php | 2 +- core/library/think/response/Json.php | 2 +- core/library/think/response/Jsonp.php | 2 +- core/library/think/response/Redirect.php | 2 +- core/library/think/response/View.php | 2 +- core/library/think/response/Xml.php | 2 +- .../library/think/session/driver/Memcache.php | 2 +- .../think/session/driver/Memcached.php | 2 +- core/library/think/session/driver/Redis.php | 2 +- core/library/think/template/TagLib.php | 2 +- core/library/think/template/driver/File.php | 2 +- core/library/think/view/driver/Php.php | 2 +- core/library/think/view/driver/Think.php | 2 +- core/library/traits/think/Instance.php | 2 +- core/start.php | 2 +- 86 files changed, 230 insertions(+), 108 deletions(-) diff --git a/application/common/controller/Fornt.php b/application/common/controller/Fornt.php index 085a716f..e378b48c 100644 --- a/application/common/controller/Fornt.php +++ b/application/common/controller/Fornt.php @@ -38,7 +38,7 @@ class Fornt extends Base { //网站主题设置 $themes['mobile'] = config('mobile_themes') ? config('mobile_themes') : 'mobile'; $themes['pc'] = config('pc_themes') ? config('pc_themes') : 'default'; - $view_path = ($this->isMobile() && config('open_mobile_site')) ? 'template/' . $themes['mobile'] . '/' : 'template/' . $themes['pc'] . '/'; + $view_path = ($this->isMobile() && config('open_mobile_site') == '1') ? 'template/' . $themes['mobile'] . '/' : 'template/' . $themes['pc'] . '/'; $module = $this->request->module(); if (!in_array($module, array('index', 'install'))) { $view_path_pre = $module . '/'; diff --git a/core/base.php b/core/base.php index 85ac946b..fdbd5d90 100644 --- a/core/base.php +++ b/core/base.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/helper.php b/core/helper.php index 02d8761a..83dbddda 100644 --- a/core/helper.php +++ b/core/helper.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/lang/zh-cn.php b/core/lang/zh-cn.php index b3fef357..6d33b0ce 100644 --- a/core/lang/zh-cn.php +++ b/core/lang/zh-cn.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/App.php b/core/library/think/App.php index a7e1ddfa..77721112 100644 --- a/core/library/think/App.php +++ b/core/library/think/App.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Build.php b/core/library/think/Build.php index dd2bd550..13b7bfdc 100644 --- a/core/library/think/Build.php +++ b/core/library/think/Build.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Cache.php b/core/library/think/Cache.php index 7e1b98a9..12107091 100644 --- a/core/library/think/Cache.php +++ b/core/library/think/Cache.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Collection.php b/core/library/think/Collection.php index cf2888d5..41b42759 100644 --- a/core/library/think/Collection.php +++ b/core/library/think/Collection.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Config.php b/core/library/think/Config.php index fb5340d8..fc6c50ac 100644 --- a/core/library/think/Config.php +++ b/core/library/think/Config.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Controller.php b/core/library/think/Controller.php index e9d6829b..69db0a1d 100644 --- a/core/library/think/Controller.php +++ b/core/library/think/Controller.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Cookie.php b/core/library/think/Cookie.php index f1c2426a..93edb8d7 100644 --- a/core/library/think/Cookie.php +++ b/core/library/think/Cookie.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Db.php b/core/library/think/Db.php index 99df4366..a29dac3e 100644 --- a/core/library/think/Db.php +++ b/core/library/think/Db.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Debug.php b/core/library/think/Debug.php index 0b5d022d..844dfb89 100644 --- a/core/library/think/Debug.php +++ b/core/library/think/Debug.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Env.php b/core/library/think/Env.php index a23d9925..6f31841d 100644 --- a/core/library/think/Env.php +++ b/core/library/think/Env.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Error.php b/core/library/think/Error.php index 28f75882..c17292bf 100644 --- a/core/library/think/Error.php +++ b/core/library/think/Error.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Exception.php b/core/library/think/Exception.php index ac648764..034c85b6 100644 --- a/core/library/think/Exception.php +++ b/core/library/think/Exception.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/File.php b/core/library/think/File.php index 60a16417..ba59273f 100644 --- a/core/library/think/File.php +++ b/core/library/think/File.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Hook.php b/core/library/think/Hook.php index 4559cd30..f06196e4 100644 --- a/core/library/think/Hook.php +++ b/core/library/think/Hook.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Lang.php b/core/library/think/Lang.php index 551481f1..d52f1947 100644 --- a/core/library/think/Lang.php +++ b/core/library/think/Lang.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Loader.php b/core/library/think/Loader.php index effd3f4a..70de3175 100644 --- a/core/library/think/Loader.php +++ b/core/library/think/Loader.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Log.php b/core/library/think/Log.php index 413e2761..4a8b0b40 100644 --- a/core/library/think/Log.php +++ b/core/library/think/Log.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Model.php b/core/library/think/Model.php index 605d48d3..b520f801 100644 --- a/core/library/think/Model.php +++ b/core/library/think/Model.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- @@ -437,9 +437,13 @@ abstract class Model implements \JsonSerializable, \ArrayAccess } elseif (isset($this->type[$name])) { // 类型转换 $value = $this->readTransform($value, $this->type[$name]); + } elseif (in_array($name, [$this->createTime, $this->updateTime])) { + $value = $this->formatDateTime($value, $this->dateFormat); } elseif ($notFound) { $method = Loader::parseName($name, 1, false); if (method_exists($this, $method) && $this->$method() instanceof Relation) { + // 清空之前的查询参数 + $this->$method()->removeOption(); // 不存在该字段 获取关联数据 $value = $this->$method()->getRelation(); // 保存关联对象值 diff --git a/core/library/think/Paginator.php b/core/library/think/Paginator.php index dc4cdeeb..d2fe79d2 100644 --- a/core/library/think/Paginator.php +++ b/core/library/think/Paginator.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Request.php b/core/library/think/Request.php index a806dd87..b72a5aaf 100644 --- a/core/library/think/Request.php +++ b/core/library/think/Request.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- @@ -688,7 +688,7 @@ class Request { if (empty($this->post)) { $content = $this->input; - if (empty($_POST) && strpos($content, '":')) { + if (empty($_POST) && 'application/json' == $this->contentType()) { $this->post = (array) json_decode($content, true); } else { $this->post = $_POST; @@ -713,7 +713,7 @@ class Request { if (is_null($this->put)) { $content = $this->input; - if (strpos($content, '":')) { + if ('application/json' == $this->contentType()) { $this->put = (array) json_decode($content, true); } else { parse_str($content, $this->put); @@ -1348,6 +1348,21 @@ class Request return $this->server('REMOTE_PORT'); } + /** + * 当前请求 HTTP_CONTENT_TYPE + * @access public + * @return string + */ + public function contentType() + { + $contentType = $this->server('CONTENT_TYPE'); + if ($contentType) { + list($type) = explode(';', $contentType); + return trim($type); + } + return ''; + } + /** * 获取当前请求的路由信息 * @access public diff --git a/core/library/think/Response.php b/core/library/think/Response.php index 8b107589..656198f0 100644 --- a/core/library/think/Response.php +++ b/core/library/think/Response.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Route.php b/core/library/think/Route.php index 7a31659a..4f08e911 100644 --- a/core/library/think/Route.php +++ b/core/library/think/Route.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- @@ -1126,8 +1126,8 @@ class Route || (isset($option['ajax']) && !$option['ajax'] && $request->isAjax()) // 非Ajax检测 || (isset($option['pjax']) && $option['pjax'] && !$request->isPjax()) // Pjax检测 || (isset($option['pjax']) && !$option['pjax'] && $request->isPjax()) // 非Pjax检测 - || (isset($option['ext']) && false === stripos($option['ext'], $request->ext())) // 伪静态后缀检测 - || (isset($option['deny_ext']) && false !== stripos($option['deny_ext'], $request->ext())) + || (isset($option['ext']) && false === stripos('|' . $option['ext'] . '|', $request->ext() ? '|' . $request->ext() . '|' : '')) // 伪静态后缀检测 + || (isset($option['deny_ext']) && false !== stripos('|' . $option['deny_ext'] . '|', $request->ext() ? '|' . $request->ext() . '|' : '')) || (isset($option['domain']) && !in_array($option['domain'], [$_SERVER['HTTP_HOST'], self::$subDomain])) // 域名检测 || (isset($option['https']) && $option['https'] && !$request->isSsl()) // https检测 || (isset($option['https']) && !$option['https'] && $request->isSsl()) // https检测 diff --git a/core/library/think/Session.php b/core/library/think/Session.php index 06adcff6..48f23caa 100644 --- a/core/library/think/Session.php +++ b/core/library/think/Session.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Template.php b/core/library/think/Template.php index 072cc80c..66ba9e18 100644 --- a/core/library/think/Template.php +++ b/core/library/think/Template.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Url.php b/core/library/think/Url.php index a1bc8d2a..51c846d7 100644 --- a/core/library/think/Url.php +++ b/core/library/think/Url.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/Validate.php b/core/library/think/Validate.php index 528861b4..e3bc9db6 100644 --- a/core/library/think/Validate.php +++ b/core/library/think/Validate.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- @@ -435,7 +435,7 @@ class Validate $rule = $field . '_confirm'; } } - return $this->getDataValue($data, $rule) == $value; + return $this->getDataValue($data, $rule) === $value; } /** diff --git a/core/library/think/View.php b/core/library/think/View.php index 1be47f4e..020e5789 100644 --- a/core/library/think/View.php +++ b/core/library/think/View.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/cache/Driver.php b/core/library/think/cache/Driver.php index f21da7bf..688507a8 100644 --- a/core/library/think/cache/Driver.php +++ b/core/library/think/cache/Driver.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/cache/driver/File.php b/core/library/think/cache/driver/File.php index 5c98d799..6f52693b 100644 --- a/core/library/think/cache/driver/File.php +++ b/core/library/think/cache/driver/File.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/cache/driver/Lite.php b/core/library/think/cache/driver/Lite.php index b9d10097..57727651 100644 --- a/core/library/think/cache/driver/Lite.php +++ b/core/library/think/cache/driver/Lite.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/cache/driver/Memcache.php b/core/library/think/cache/driver/Memcache.php index ca2f8aa8..d41939d8 100644 --- a/core/library/think/cache/driver/Memcache.php +++ b/core/library/think/cache/driver/Memcache.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/cache/driver/Memcached.php b/core/library/think/cache/driver/Memcached.php index 4c4505b0..35fafd07 100644 --- a/core/library/think/cache/driver/Memcached.php +++ b/core/library/think/cache/driver/Memcached.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/cache/driver/Redis.php b/core/library/think/cache/driver/Redis.php index e7f78762..360f515a 100644 --- a/core/library/think/cache/driver/Redis.php +++ b/core/library/think/cache/driver/Redis.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/cache/driver/Sqlite.php b/core/library/think/cache/driver/Sqlite.php index 907f93df..76c592d8 100644 --- a/core/library/think/cache/driver/Sqlite.php +++ b/core/library/think/cache/driver/Sqlite.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/cache/driver/Wincache.php b/core/library/think/cache/driver/Wincache.php index 11d059e4..5be8d0df 100644 --- a/core/library/think/cache/driver/Wincache.php +++ b/core/library/think/cache/driver/Wincache.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/cache/driver/Xcache.php b/core/library/think/cache/driver/Xcache.php index e790ef7c..317a4ee3 100644 --- a/core/library/think/cache/driver/Xcache.php +++ b/core/library/think/cache/driver/Xcache.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/config/driver/Ini.php b/core/library/think/config/driver/Ini.php index d8dc558d..a223a578 100644 --- a/core/library/think/config/driver/Ini.php +++ b/core/library/think/config/driver/Ini.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/config/driver/Json.php b/core/library/think/config/driver/Json.php index ec2419f9..557f75fe 100644 --- a/core/library/think/config/driver/Json.php +++ b/core/library/think/config/driver/Json.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/config/driver/Xml.php b/core/library/think/config/driver/Xml.php index 5bc93015..b573a562 100644 --- a/core/library/think/config/driver/Xml.php +++ b/core/library/think/config/driver/Xml.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/controller/Rest.php b/core/library/think/controller/Rest.php index a75cfd37..c297f4eb 100644 --- a/core/library/think/controller/Rest.php +++ b/core/library/think/controller/Rest.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/db/Builder.php b/core/library/think/db/Builder.php index 51b7a871..2372152c 100644 --- a/core/library/think/db/Builder.php +++ b/core/library/think/db/Builder.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- @@ -334,9 +334,19 @@ abstract class Builder } $whereStr = ''; - if (in_array($exp, ['=', '<>', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE'])) { + if (in_array($exp, ['=', '<>', '>', '>=', '<', '<='])) { // 比较运算 及 模糊匹配 $whereStr .= $key . ' ' . $exp . ' ' . $this->parseValue($value, $field); + } elseif ('LIKE' == $exp || 'NOT LIKE' == $exp) { + if (is_array($value)) { + foreach ($value as $item) { + $array[] = $key . ' ' . $exp . ' ' . $this->parseValue($item, $field); + } + $logic = isset($val[2]) ? $val[2] : 'AND'; + $whereStr .= '(' . implode($array, ' ' . strtoupper($logic) . ' ') . ')'; + } else { + $whereStr .= $key . ' ' . $exp . ' ' . $this->parseValue($value, $field); + } } elseif ('EXP' == $exp) { // 表达式查询 $whereStr .= '( ' . $key . ' ' . $value . ' )'; diff --git a/core/library/think/db/Connection.php b/core/library/think/db/Connection.php index e5c60aae..ef56c6fd 100644 --- a/core/library/think/db/Connection.php +++ b/core/library/think/db/Connection.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- @@ -337,7 +337,7 @@ abstract class Connection $this->queryStr = $this->getRealSql($sql, $bind); //释放前次的查询结果 - if (!empty($this->PDOStatement)) { + if (!empty($this->PDOStatement) && $this->PDOStatement->queryString != $sql) { $this->free(); } @@ -346,11 +346,13 @@ abstract class Connection // 调试开始 $this->debug(true); // 预处理 - $this->PDOStatement = $this->linkID->prepare($sql); + if (empty($this->PDOStatement)) { + $this->PDOStatement = $this->linkID->prepare($sql); + } // 参数绑定 $this->bindValue($bind); // 执行查询 - $result = $this->PDOStatement->execute(); + $this->PDOStatement->execute(); // 调试结束 $this->debug(false); $procedure = in_array(strtolower(substr(trim($sql), 0, 4)), ['call', 'exec']); @@ -379,7 +381,7 @@ abstract class Connection $this->queryStr = $this->getRealSql($sql, $bind); //释放前次的查询结果 - if (!empty($this->PDOStatement)) { + if (!empty($this->PDOStatement) && $this->PDOStatement->queryString != $sql) { $this->free(); } @@ -388,11 +390,13 @@ abstract class Connection // 调试开始 $this->debug(true); // 预处理 - $this->PDOStatement = $this->linkID->prepare($sql); + if (empty($this->PDOStatement)) { + $this->PDOStatement = $this->linkID->prepare($sql); + } // 参数绑定操作 $this->bindValue($bind); // 执行语句 - $result = $this->PDOStatement->execute(); + $this->PDOStatement->execute(); // 调试结束 $this->debug(false); diff --git a/core/library/think/db/Query.php b/core/library/think/db/Query.php index 7bc75c3d..263565f9 100644 --- a/core/library/think/db/Query.php +++ b/core/library/think/db/Query.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- @@ -797,6 +797,68 @@ class Query return $this; } + /** + * 设置数据 + * @access public + * @param mixed $field 字段名或者数据 + * @param mixed $value 字段值 + * @return $this + */ + public function data($field, $value = null) + { + if (is_array($field)) { + $this->options['data'] = isset($this->options['data']) ? array_merge($this->options['data'], $field) : $field; + } else { + $this->options['data'][$field] = $value; + } + return $this; + } + + /** + * 字段值增长 + * @access public + * @param string|array $field 字段名 + * @param integer $step 增长值 + * @return $this + */ + public function inc($field, $step = 1) + { + $fields = is_string($field) ? explode(',', $field) : $field; + foreach ($fields as $field) { + $this->data($field, ['exp', $field . '+' . $step]); + } + return $this; + } + + /** + * 字段值减少 + * @access public + * @param string|array $field 字段名 + * @param integer $step 增长值 + * @return $this + */ + public function dec($field, $step = 1) + { + $fields = is_string($field) ? explode(',', $field) : $field; + foreach ($fields as $field) { + $this->data($field, ['exp', $field . '-' . $step]); + } + return $this; + } + + /** + * 使用表达式设置数据 + * @access public + * @param string $field 字段名 + * @param string $value 字段值 + * @return $this + */ + public function exp($field, $value) + { + $this->data($field, ['exp', $value]); + return $this; + } + /** * 指定JOIN查询字段 * @access public @@ -956,7 +1018,11 @@ class Query // 字段相等查询 $where[$field] = ['eq', $op]; } else { - $where[$field] = [$op, $condition]; + $where[$field] = [$op, $condition, isset($param[2]) ? $param[2] : null]; + if ('exp' == strtolower($op) && isset($param[2]) && is_array($param[2])) { + // 参数绑定 + $this->bind($param[2]); + } // 记录一个字段多次查询条件 $this->options['multi'][$field][] = $where[$field]; } @@ -1000,14 +1066,16 @@ class Query } /** - * 去除某个查询参数 + * 去除查询参数 * @access public - * @param string $option 参数名 + * @param string|bool $option 参数名 true 表示去除所有参数 * @return $this */ - public function removeOption($option) + public function removeOption($option = true) { - if (isset($this->options[$option])) { + if (true === $option) { + $this->options = []; + } elseif (is_string($option) && isset($this->options[$option])) { unset($this->options[$option]); } return $this; @@ -1796,10 +1864,11 @@ class Query * @param string $sequence 自增序列名 * @return integer|string */ - public function insert(array $data, $replace = false, $getLastInsID = false, $sequence = null) + public function insert(array $data = [], $replace = false, $getLastInsID = false, $sequence = null) { // 分析查询表达式 $options = $this->parseExpress(); + $data = array_merge($options['data'], $data); // 生成SQL语句 $sql = $this->builder->insert($data, $options, $replace); // 获取参数绑定 @@ -1894,9 +1963,10 @@ class Query * @throws Exception * @throws PDOException */ - public function update(array $data) + public function update(array $data = []) { $options = $this->parseExpress(); + $data = array_merge($options['data'], $data); $pk = $this->getPk($options); if (isset($options['cache']) && is_string($options['cache'])) { $key = $options['cache']; @@ -2376,6 +2446,10 @@ class Query $options['field'] = '*'; } + if (!isset($options['data'])) { + $options['data'] = []; + } + if (!isset($options['strict'])) { $options['strict'] = $this->getConfig('fields_strict'); } diff --git a/core/library/think/db/builder/Mysql.php b/core/library/think/db/builder/Mysql.php index a3e223ed..de38fac5 100644 --- a/core/library/think/db/builder/Mysql.php +++ b/core/library/think/db/builder/Mysql.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/db/builder/Pgsql.php b/core/library/think/db/builder/Pgsql.php index e6e7dffa..8b853a2f 100644 --- a/core/library/think/db/builder/Pgsql.php +++ b/core/library/think/db/builder/Pgsql.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/db/builder/Sqlite.php b/core/library/think/db/builder/Sqlite.php index c9f55027..02d1bf2e 100644 --- a/core/library/think/db/builder/Sqlite.php +++ b/core/library/think/db/builder/Sqlite.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/db/connector/Mysql.php b/core/library/think/db/connector/Mysql.php index 47b069fb..31435694 100644 --- a/core/library/think/db/connector/Mysql.php +++ b/core/library/think/db/connector/Mysql.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- @@ -51,10 +51,13 @@ class Mysql extends Connection { $this->initConnect(true); list($tableName) = explode(' ', $tableName); - if (strpos($tableName, '.')) { - $tableName = str_replace('.', '`.`', $tableName); + if (false === strpos($tableName, '`')) { + if (strpos($tableName, '.')) { + $tableName = str_replace('.', '`.`', $tableName); + } + $tableName = '`' . $tableName . '`'; } - $sql = 'SHOW COLUMNS FROM `' . $tableName . '`'; + $sql = 'SHOW COLUMNS FROM ' . $tableName; // 调试开始 $this->debug(true); $pdo = $this->linkID->query($sql); diff --git a/core/library/think/db/connector/Pgsql.php b/core/library/think/db/connector/Pgsql.php index e9866cf3..4f8756ca 100644 --- a/core/library/think/db/connector/Pgsql.php +++ b/core/library/think/db/connector/Pgsql.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/db/connector/Sqlite.php b/core/library/think/db/connector/Sqlite.php index 95b023e5..4a08c740 100644 --- a/core/library/think/db/connector/Sqlite.php +++ b/core/library/think/db/connector/Sqlite.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/db/exception/BindParamException.php b/core/library/think/db/exception/BindParamException.php index 3872e7c0..d0e2387b 100644 --- a/core/library/think/db/exception/BindParamException.php +++ b/core/library/think/db/exception/BindParamException.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/db/exception/DataNotFoundException.php b/core/library/think/db/exception/DataNotFoundException.php index cd4253ab..e399b063 100644 --- a/core/library/think/db/exception/DataNotFoundException.php +++ b/core/library/think/db/exception/DataNotFoundException.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/db/exception/ModelNotFoundException.php b/core/library/think/db/exception/ModelNotFoundException.php index 1d4724a6..2180ab07 100644 --- a/core/library/think/db/exception/ModelNotFoundException.php +++ b/core/library/think/db/exception/ModelNotFoundException.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/exception/DbException.php b/core/library/think/exception/DbException.php index bd6fb442..656d6913 100644 --- a/core/library/think/exception/DbException.php +++ b/core/library/think/exception/DbException.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/exception/ErrorException.php b/core/library/think/exception/ErrorException.php index 2f1525c0..e3f18375 100644 --- a/core/library/think/exception/ErrorException.php +++ b/core/library/think/exception/ErrorException.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/exception/PDOException.php b/core/library/think/exception/PDOException.php index 1d88e9f6..ebd53dff 100644 --- a/core/library/think/exception/PDOException.php +++ b/core/library/think/exception/PDOException.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/model/Merge.php b/core/library/think/model/Merge.php index 5edb2a45..b876c2f3 100644 --- a/core/library/think/model/Merge.php +++ b/core/library/think/model/Merge.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/model/Pivot.php b/core/library/think/model/Pivot.php index 24034b07..7823370c 100644 --- a/core/library/think/model/Pivot.php +++ b/core/library/think/model/Pivot.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/model/Relation.php b/core/library/think/model/Relation.php index 4fc68ff2..e940a78d 100644 --- a/core/library/think/model/Relation.php +++ b/core/library/think/model/Relation.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- @@ -92,6 +92,17 @@ abstract class Relation return $this; } + /** + * 移除关联查询参数 + * @access public + * @return $this + */ + public function removeOption() + { + $this->query->removeOption(); + return $this; + } + public function __call($method, $args) { if ($this->query) { diff --git a/core/library/think/model/relation/BelongsTo.php b/core/library/think/model/relation/BelongsTo.php index 0f1f0c73..8f26d033 100644 --- a/core/library/think/model/relation/BelongsTo.php +++ b/core/library/think/model/relation/BelongsTo.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/model/relation/BelongsToMany.php b/core/library/think/model/relation/BelongsToMany.php index e1849d89..bbab3714 100644 --- a/core/library/think/model/relation/BelongsToMany.php +++ b/core/library/think/model/relation/BelongsToMany.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/model/relation/HasMany.php b/core/library/think/model/relation/HasMany.php index e5690137..c9235bac 100644 --- a/core/library/think/model/relation/HasMany.php +++ b/core/library/think/model/relation/HasMany.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/model/relation/HasManyThrough.php b/core/library/think/model/relation/HasManyThrough.php index 79a822f3..2585f354 100644 --- a/core/library/think/model/relation/HasManyThrough.php +++ b/core/library/think/model/relation/HasManyThrough.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/model/relation/HasOne.php b/core/library/think/model/relation/HasOne.php index 4ac1a589..41667e2a 100644 --- a/core/library/think/model/relation/HasOne.php +++ b/core/library/think/model/relation/HasOne.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/model/relation/MorphMany.php b/core/library/think/model/relation/MorphMany.php index d76052ed..abb32ebd 100644 --- a/core/library/think/model/relation/MorphMany.php +++ b/core/library/think/model/relation/MorphMany.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/model/relation/MorphTo.php b/core/library/think/model/relation/MorphTo.php index fa691489..e6676574 100644 --- a/core/library/think/model/relation/MorphTo.php +++ b/core/library/think/model/relation/MorphTo.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/model/relation/OneToOne.php b/core/library/think/model/relation/OneToOne.php index 0f22898b..ef21bee0 100644 --- a/core/library/think/model/relation/OneToOne.php +++ b/core/library/think/model/relation/OneToOne.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- @@ -160,6 +160,7 @@ abstract class OneToOne extends Relation */ public function getEagerlyType() { + $this->removeOption(); return $this->eagerlyType; } diff --git a/core/library/think/paginator/Collection.php b/core/library/think/paginator/Collection.php index 50803ba8..0c877388 100644 --- a/core/library/think/paginator/Collection.php +++ b/core/library/think/paginator/Collection.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/paginator/driver/Bootstrap.php b/core/library/think/paginator/driver/Bootstrap.php index 13b7bccd..58fa9436 100644 --- a/core/library/think/paginator/driver/Bootstrap.php +++ b/core/library/think/paginator/driver/Bootstrap.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/response/Json.php b/core/library/think/response/Json.php index 027aa2a3..538fc5a0 100644 --- a/core/library/think/response/Json.php +++ b/core/library/think/response/Json.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/response/Jsonp.php b/core/library/think/response/Jsonp.php index b92aa9f6..de8fb304 100644 --- a/core/library/think/response/Jsonp.php +++ b/core/library/think/response/Jsonp.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/response/Redirect.php b/core/library/think/response/Redirect.php index a3104c2f..f2002779 100644 --- a/core/library/think/response/Redirect.php +++ b/core/library/think/response/Redirect.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/response/View.php b/core/library/think/response/View.php index 3a5f3660..de75515a 100644 --- a/core/library/think/response/View.php +++ b/core/library/think/response/View.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/response/Xml.php b/core/library/think/response/Xml.php index 3a2c59bd..ca12e295 100644 --- a/core/library/think/response/Xml.php +++ b/core/library/think/response/Xml.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/session/driver/Memcache.php b/core/library/think/session/driver/Memcache.php index 78320864..0c02e23e 100644 --- a/core/library/think/session/driver/Memcache.php +++ b/core/library/think/session/driver/Memcache.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/session/driver/Memcached.php b/core/library/think/session/driver/Memcached.php index c5df23dc..bcaf8a1b 100644 --- a/core/library/think/session/driver/Memcached.php +++ b/core/library/think/session/driver/Memcached.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/session/driver/Redis.php b/core/library/think/session/driver/Redis.php index b1632f9e..a4c2b54a 100644 --- a/core/library/think/session/driver/Redis.php +++ b/core/library/think/session/driver/Redis.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/template/TagLib.php b/core/library/think/template/TagLib.php index 101593bf..b3325191 100644 --- a/core/library/think/template/TagLib.php +++ b/core/library/think/template/TagLib.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/template/driver/File.php b/core/library/think/template/driver/File.php index 1cd041af..b27e7265 100644 --- a/core/library/think/template/driver/File.php +++ b/core/library/think/template/driver/File.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/view/driver/Php.php b/core/library/think/view/driver/Php.php index b7028c2d..468d3611 100644 --- a/core/library/think/view/driver/Php.php +++ b/core/library/think/view/driver/Php.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/think/view/driver/Think.php b/core/library/think/view/driver/Think.php index e5336b41..39a14ca3 100644 --- a/core/library/think/view/driver/Think.php +++ b/core/library/think/view/driver/Think.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/library/traits/think/Instance.php b/core/library/traits/think/Instance.php index 4dd005e4..ba45ddd8 100644 --- a/core/library/traits/think/Instance.php +++ b/core/library/traits/think/Instance.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- diff --git a/core/start.php b/core/start.php index 2d517914..8af62ef3 100644 --- a/core/start.php +++ b/core/start.php @@ -2,7 +2,7 @@ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- -// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved. +// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +----------------------------------------------------------------------