修复 WHERE IN / NOT IN 型查询条件为空导致的 sql 语法错误

This commit is contained in:
Jim Liu
2017-02-15 12:22:58 +08:00
committed by GitHub
parent 855124a514
commit e8df221a8d

View File

@@ -379,7 +379,7 @@ abstract class Builder
} else {
$zone = implode(',', $this->parseValue($value, $field));
}
$whereStr .= $key . ' ' . $exp . ' (' . $zone . ')';
$whereStr .= $key . ' ' . $exp . ' (' . (empty($zone) ? "''" : $zone) . ')';
}
} elseif (in_array($exp, ['NOT BETWEEN', 'BETWEEN'])) {
// BETWEEN 查询