diff --git a/library/think/Validate.php b/library/think/Validate.php index 69384667..1df14f11 100644 --- a/library/think/Validate.php +++ b/library/think/Validate.php @@ -165,7 +165,7 @@ class Validate } /** - * 获取验证规则的默认提示信息 + * 设置验证规则的默认提示信息 * @access protected * @param string|array $type 验证规则类型名称或者数组 * @param string $msg 验证提示信息 diff --git a/library/think/db/Builder.php b/library/think/db/Builder.php index ecec0b0e..23f88836 100644 --- a/library/think/db/Builder.php +++ b/library/think/db/Builder.php @@ -376,7 +376,7 @@ abstract class Builder if ($value instanceof \Closure) { $whereStr .= $key . ' ' . $exp . ' ' . $this->parseClosure($value); } else { - $value = is_array($value) ? $value : explode(',', $value); + $value = array_unique(is_array($value) ? $value : explode(',', $value)); if (array_key_exists($field, $binds)) { $bind = []; $array = []; diff --git a/library/think/db/Query.php b/library/think/db/Query.php index b08436cd..a8722a1a 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -395,7 +395,7 @@ class Query public function value($field, $default = null, $force = false) { $result = false; - if (empty($options['fetch_sql']) && !empty($this->options['cache'])) { + if (empty($this->options['fetch_sql']) && !empty($this->options['cache'])) { // 判断查询缓存 $cache = $this->options['cache']; if (empty($this->options['table'])) { @@ -438,7 +438,7 @@ class Query public function column($field, $key = '') { $result = false; - if (empty($options['fetch_sql']) && !empty($this->options['cache'])) { + if (empty($this->options['fetch_sql']) && !empty($this->options['cache'])) { // 判断查询缓存 $cache = $this->options['cache']; if (empty($this->options['table'])) {