mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 07:32:48 +08:00
改进Query类的insertGetId方法 支持传入自增序列名
This commit is contained in:
@@ -163,9 +163,9 @@ class Query
|
|||||||
* @throws DbBindParamException
|
* @throws DbBindParamException
|
||||||
* @throws PDOException
|
* @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
|
* @access public
|
||||||
* @param mixed $data 数据
|
* @param mixed $data 数据
|
||||||
* @param boolean $replace 是否replace
|
* @param boolean $replace 是否replace
|
||||||
|
* @param string $sequence 自增序列名
|
||||||
* @return integer
|
* @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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user