改进where方法对原生条件的判断

This commit is contained in:
thinkphp
2016-04-28 14:36:46 +08:00
parent 810a88a48e
commit c9ab0cc72a

View File

@@ -491,7 +491,7 @@ class Query
if (is_string($field) && !empty($this->options['via'])) {
$field = $this->options['via'] . '.' . $field;
}
if (is_string($field) && strpos($field, ' ')) {
if (is_string($field) && preg_match('/[,=\>\<\'\"\(`.\s]/', $field)) {
$where[] = ['exp', $field];
if (is_array($op)) {
// 参数绑定