mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
改进Connection类的getLastInsID方法获取
This commit is contained in:
@@ -37,8 +37,6 @@ abstract class Connection
|
|||||||
|
|
||||||
/** @var string 当前SQL指令 */
|
/** @var string 当前SQL指令 */
|
||||||
protected $queryStr = '';
|
protected $queryStr = '';
|
||||||
// 最后插入ID
|
|
||||||
protected $lastInsID;
|
|
||||||
// 返回或者影响记录数
|
// 返回或者影响记录数
|
||||||
protected $numRows = 0;
|
protected $numRows = 0;
|
||||||
// 事务指令数
|
// 事务指令数
|
||||||
@@ -699,10 +697,7 @@ abstract class Connection
|
|||||||
*/
|
*/
|
||||||
public function getLastInsID($sequence = null)
|
public function getLastInsID($sequence = null)
|
||||||
{
|
{
|
||||||
if (is_null($this->lastInsID)) {
|
return $this->linkID->lastInsertId($sequence);
|
||||||
$this->lastInsID = $this->linkID->lastInsertId($sequence);
|
|
||||||
}
|
|
||||||
return $this->lastInsID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user