Query类的column方法支持传入*号

This commit is contained in:
thinkphp
2016-05-03 20:32:40 +08:00
parent 0af5b072a9
commit 32c148ff2b

View File

@@ -131,7 +131,7 @@ class Query
$result = Cache::get($guid);
}
if (!$result) {
$key = $key ? $key . ',' : '';
$key = ($key && '*' != $field) ? $key . ',' : '';
$pdo = $this->field($key . $field)->fetchPdo(true)->select();
if (1 == $pdo->columnCount()) {
$result = $pdo->fetchAll(PDO::FETCH_COLUMN);