改进一个字段多次查询条件

This commit is contained in:
thinkphp
2017-09-05 18:12:05 +08:00
parent 4ef35fa4bb
commit 067237fa1f

View File

@@ -1188,9 +1188,7 @@ class Query
} elseif (is_null($condition)) { } elseif (is_null($condition)) {
// 字段相等查询 // 字段相等查询
$where[$field] = ['eq', $op]; $where[$field] = ['eq', $op];
if ('AND' != $logic) {
$this->options['multi'][$logic][$field][] = $where[$field]; $this->options['multi'][$logic][$field][] = $where[$field];
}
} else { } else {
$where[$field] = [$op, $condition, isset($param[2]) ? $param[2] : null]; $where[$field] = [$op, $condition, isset($param[2]) ? $param[2] : null];
if ('exp' == strtolower($op) && isset($param[2]) && is_array($param[2])) { if ('exp' == strtolower($op) && isset($param[2]) && is_array($param[2])) {