mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
修正闭包查询
This commit is contained in:
@@ -330,7 +330,9 @@ abstract class Builder
|
|||||||
} elseif (in_array($exp, ['NOT IN', 'IN'])) {
|
} elseif (in_array($exp, ['NOT IN', 'IN'])) {
|
||||||
// IN 查询
|
// IN 查询
|
||||||
if ($value instanceof \Closure) {
|
if ($value instanceof \Closure) {
|
||||||
|
$query = $this->query;
|
||||||
$whereStr .= $key . ' ' . $exp . ' ' . $this->parseClosure($value);
|
$whereStr .= $key . ' ' . $exp . ' ' . $this->parseClosure($value);
|
||||||
|
$this->query = $query;
|
||||||
} else {
|
} else {
|
||||||
$value = is_array($value) ? $value : explode(',', $value);
|
$value = is_array($value) ? $value : explode(',', $value);
|
||||||
if (array_key_exists($field, $binds)) {
|
if (array_key_exists($field, $binds)) {
|
||||||
@@ -376,7 +378,9 @@ abstract class Builder
|
|||||||
} elseif (in_array($exp, ['NOT EXISTS', 'EXISTS'])) {
|
} elseif (in_array($exp, ['NOT EXISTS', 'EXISTS'])) {
|
||||||
// EXISTS 查询
|
// EXISTS 查询
|
||||||
if ($value instanceof \Closure) {
|
if ($value instanceof \Closure) {
|
||||||
|
$query = $this->query;
|
||||||
$whereStr .= $exp . ' ' . $this->parseClosure($value);
|
$whereStr .= $exp . ' ' . $this->parseClosure($value);
|
||||||
|
$this->query = $query;
|
||||||
} else {
|
} else {
|
||||||
$whereStr .= $exp . ' (' . $value . ')';
|
$whereStr .= $exp . ' (' . $value . ')';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user