From 4d9a4bcaae8447d83cae81f5dc1f74a67c39c21e Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 12 Jun 2016 17:26:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Oracle=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/connector/Oracle.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/think/db/connector/Oracle.php b/library/think/db/connector/Oracle.php index 7e067aea..7364c506 100644 --- a/library/think/db/connector/Oracle.php +++ b/library/think/db/connector/Oracle.php @@ -51,7 +51,7 @@ class Oracle extends Connection * @throws \Exception * @throws \think\Exception */ - public function execute($sql, $bind = [], $fetch = false) + public function execute($sql, $bind = [], $fetch = false, $getLastInsID = false, $sequence = null) { $this->initConnect(true); if (!$this->linkID) { @@ -85,6 +85,9 @@ class Oracle extends Connection $this->numRows = $this->PDOStatement->rowCount(); if ($flag || preg_match("/^\s*(INSERT\s+INTO|REPLACE\s+INTO)\s+/i", $sql)) { $this->lastInsID = $this->linkID->lastInsertId(); + if ($getLastInsID) { + return $this->lastInsID; + } } return $this->numRows; } catch (\PDOException $e) {