mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
改进where对空条件的判断
This commit is contained in:
@@ -665,11 +665,12 @@ abstract class Driver
|
|||||||
}
|
}
|
||||||
|
|
||||||
$where = $this->parseWhereExp($field, $op, $condition);
|
$where = $this->parseWhereExp($field, $op, $condition);
|
||||||
|
if (!empty($where)) {
|
||||||
if (!isset($this->options['where']['AND'])) {
|
if (!isset($this->options['where']['AND'])) {
|
||||||
$this->options['where']['AND'] = [];
|
$this->options['where']['AND'] = [];
|
||||||
|
}
|
||||||
|
$this->options['where']['AND'] = array_merge($this->options['where']['AND'], $where);
|
||||||
}
|
}
|
||||||
$this->options['where']['AND'] = array_merge($this->options['where']['AND'], $where);
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -684,10 +685,12 @@ abstract class Driver
|
|||||||
public function whereOr($field, $op = null, $condition = null)
|
public function whereOr($field, $op = null, $condition = null)
|
||||||
{
|
{
|
||||||
$where = $this->parseWhereExp($field, $op, $condition);
|
$where = $this->parseWhereExp($field, $op, $condition);
|
||||||
if (!isset($this->options['where']['OR'])) {
|
if (!empty($where)) {
|
||||||
$this->options['where']['OR'] = [];
|
if (!isset($this->options['where']['OR'])) {
|
||||||
|
$this->options['where']['OR'] = [];
|
||||||
|
}
|
||||||
|
$this->options['where']['OR'] = array_merge($this->options['where']['OR'], $where);
|
||||||
}
|
}
|
||||||
$this->options['where']['OR'] = array_merge($this->options['where']['OR'], $where);
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user