mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 07:02:47 +08:00
改进Query类和Build类 改进查询语法
This commit is contained in:
@@ -282,8 +282,15 @@ abstract class Builder
|
||||
|
||||
// 对一个字段使用多个查询条件
|
||||
if (is_array($exp)) {
|
||||
$item = array_pop($val);
|
||||
// 传入 or 或者 and
|
||||
if (is_string($item) && in_array($item, ['AND', 'and', 'OR', 'or'])) {
|
||||
$rule = $item;
|
||||
} else {
|
||||
array_push($val, $item);
|
||||
}
|
||||
foreach ($val as $item) {
|
||||
$str[] = $this->parseWhereItem($key, $item);
|
||||
$str[] = $this->parseWhereItem($key, $item, $rule);
|
||||
}
|
||||
return '( ' . implode(' ' . $rule . ' ', $str) . ' )';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user