mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
比较运算支持使用闭包子查询
This commit is contained in:
@@ -348,9 +348,14 @@ abstract class Builder
|
|||||||
|
|
||||||
$whereStr = '';
|
$whereStr = '';
|
||||||
if (in_array($exp, ['=', '<>', '>', '>=', '<', '<='])) {
|
if (in_array($exp, ['=', '<>', '>', '>=', '<', '<='])) {
|
||||||
// 比较运算 及 模糊匹配
|
// 比较运算
|
||||||
$whereStr .= $key . ' ' . $exp . ' ' . $this->parseValue($value, $field);
|
if ($value instanceof \Closure) {
|
||||||
|
$whereStr .= $key . ' ' . $exp . ' ' . $this->parseClosure($value);
|
||||||
|
} else {
|
||||||
|
$whereStr .= $key . ' ' . $exp . ' ' . $this->parseValue($value, $field);
|
||||||
|
}
|
||||||
} elseif ('LIKE' == $exp || 'NOT LIKE' == $exp) {
|
} elseif ('LIKE' == $exp || 'NOT LIKE' == $exp) {
|
||||||
|
// 模糊匹配
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
foreach ($value as $item) {
|
foreach ($value as $item) {
|
||||||
$array[] = $key . ' ' . $exp . ' ' . $this->parseValue($item, $field);
|
$array[] = $key . ' ' . $exp . ' ' . $this->parseValue($item, $field);
|
||||||
|
|||||||
Reference in New Issue
Block a user