\think\Db::view('Config', 'id, name, title, extra, remark, value')这一句$field参数中如果逗号后带空格,就会报:SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'name,Config. title FROM。。。这样的错误了。在db/query.php的888行:
if (is_string($field)) {
$field = explode(',', $field);
}感觉有必要对结果trim一下。 最佳答案