From 6dd393bd711043393751e977064def2393362522 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 20 May 2016 11:10:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BQuery=E7=B1=BB=E7=9A=84insert?= =?UTF-8?q?GetId=E6=96=B9=E6=B3=95=20=E6=94=AF=E6=8C=81=E4=BC=A0=E5=85=A5?= =?UTF-8?q?=E8=87=AA=E5=A2=9E=E5=BA=8F=E5=88=97=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 4b0d2a54..bf52b988 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -163,9 +163,9 @@ class Query * @throws DbBindParamException * @throws PDOException */ - public function execute($sql, $bind = [], $fetch = false, $getLastInsID = false,$sequence = null) + public function execute($sql, $bind = [], $fetch = false, $getLastInsID = false, $sequence = null) { - return $this->connection->execute($sql, $bind, $fetch, $getLastInsID,$sequence); + return $this->connection->execute($sql, $bind, $fetch, $getLastInsID, $sequence); } /** @@ -1333,11 +1333,12 @@ class Query * @access public * @param mixed $data 数据 * @param boolean $replace 是否replace + * @param string $sequence 自增序列名 * @return integer */ - public function insertGetId(array $data, $replace = false) + public function insertGetId(array $data, $replace = false, $sequence = null) { - return $this->insert($data, $replace, true); + return $this->insert($data, $replace, true, $sequence); } /**