内核更新,标签的更新
This commit is contained in:
@@ -178,16 +178,15 @@ class Query
|
||||
* @access public
|
||||
* @param string $sql sql指令
|
||||
* @param array $bind 参数绑定
|
||||
* @param boolean $fetch 不执行只是获取SQL
|
||||
* @param boolean $master 是否在主服务器读操作
|
||||
* @param bool|string $class 指定返回的数据集对象
|
||||
* @return mixed
|
||||
* @throws BindParamException
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function query($sql, $bind = [], $fetch = false, $master = false, $class = false)
|
||||
public function query($sql, $bind = [], $master = false, $class = false)
|
||||
{
|
||||
return $this->connection->query($sql, $bind, $fetch, $master, $class);
|
||||
return $this->connection->query($sql, $bind, $master, $class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,16 +194,15 @@ class Query
|
||||
* @access public
|
||||
* @param string $sql sql指令
|
||||
* @param array $bind 参数绑定
|
||||
* @param boolean $fetch 不执行只是获取SQL
|
||||
* @param boolean $getLastInsID 是否获取自增ID
|
||||
* @param boolean $sequence 自增序列名
|
||||
* @return int
|
||||
* @throws BindParamException
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function execute($sql, $bind = [], $fetch = false, $getLastInsID = false, $sequence = null)
|
||||
public function execute($sql, $bind = [], $getLastInsID = false, $sequence = null)
|
||||
{
|
||||
return $this->connection->execute($sql, $bind, $fetch, $getLastInsID, $sequence);
|
||||
return $this->connection->execute($sql, $bind, $getLastInsID, $sequence);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1466,7 +1464,7 @@ class Query
|
||||
unset($this->options['with_field']);
|
||||
}
|
||||
}
|
||||
$this->field($field, false, $joinTable, $joinAlias, $joinName . '__');
|
||||
$this->field($field, false, $joinTable, $joinAlias, $relation . '__');
|
||||
$i++;
|
||||
} elseif ($closure) {
|
||||
$with[$key] = $closure;
|
||||
@@ -1873,7 +1871,7 @@ class Query
|
||||
* @throws Exception
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function selectOrFail($data = [])
|
||||
public function selectOrFail($data = null)
|
||||
{
|
||||
return $this->failException(true)->select($data);
|
||||
}
|
||||
@@ -1887,7 +1885,7 @@ class Query
|
||||
* @throws Exception
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function findOrFail($data = [])
|
||||
public function findOrFail($data = null)
|
||||
{
|
||||
return $this->failException(true)->find($data);
|
||||
}
|
||||
@@ -1950,22 +1948,22 @@ class Query
|
||||
/**
|
||||
* 删除记录
|
||||
* @access public
|
||||
* @param array $data 表达式
|
||||
* @param mixed $data 表达式 true 表示强制删除
|
||||
* @return int
|
||||
* @throws Exception
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function delete($data = [])
|
||||
public function delete($data = null)
|
||||
{
|
||||
// 分析查询表达式
|
||||
$options = $this->parseExpress();
|
||||
|
||||
if (!empty($data)) {
|
||||
if (!is_null($data) && true !== $data) {
|
||||
// AR模式分析主键条件
|
||||
$this->parsePkWhere($data, $options);
|
||||
}
|
||||
|
||||
if (empty($options['where'])) {
|
||||
if (true !== $data && empty($options['where'])) {
|
||||
// 如果条件为空 不进行删除操作 除非设置 1=1
|
||||
throw new Exception('delete without condition');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user