From 92496f65a141160995f4eb50fcfb551feb99e035 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 20 May 2016 14:47:20 +0800 Subject: [PATCH] =?UTF-8?q?Query=E7=B1=BB=E5=A2=9E=E5=8A=A0getlastsql?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 2 +- library/think/db/Query.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/library/think/Request.php b/library/think/Request.php index e7c29c72..a261594e 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -270,7 +270,7 @@ class Request } /** - * 获取URL访问根目录 + * 获取URL访问根地址 * @access public * @param string $url URL地址 * @return string diff --git a/library/think/db/Query.php b/library/think/db/Query.php index bf52b988..476bf7bc 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -178,6 +178,16 @@ class Query return $this->connection->getLastInsID(); } + /** + * 获取最近一次查询的sql语句 + * @access public + * @return string + */ + public function getLastSql() + { + return $this->connection->queryStr; + } + /** * 执行数据库事务 * @access public