改进Connection类的getLastInsID方法获取

This commit is contained in:
thinkphp
2016-08-17 16:37:08 +08:00
parent a77f702a9f
commit bce9e36ded

View File

@@ -37,8 +37,6 @@ abstract class Connection
/** @var string 当前SQL指令 */
protected $queryStr = '';
// 最后插入ID
protected $lastInsID;
// 返回或者影响记录数
protected $numRows = 0;
// 事务指令数
@@ -699,10 +697,7 @@ abstract class Connection
*/
public function getLastInsID($sequence = null)
{
if (is_null($this->lastInsID)) {
$this->lastInsID = $this->linkID->lastInsertId($sequence);
}
return $this->lastInsID;
return $this->linkID->lastInsertId($sequence);
}
/**