mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
改进Query类的field方法
This commit is contained in:
@@ -728,11 +728,11 @@ class Query
|
|||||||
}
|
}
|
||||||
if (true === $field) {
|
if (true === $field) {
|
||||||
// 获取全部字段
|
// 获取全部字段
|
||||||
$fields = isset($this->options['allow_field']) ? $this->options['allow_field'] : $this->getTableInfo($tableName, 'fields');
|
$fields = isset($this->options['allow_field']) ? $this->options['allow_field'] : $this->getTableInfo($tableName ?: $this->options['table'], 'fields');
|
||||||
$field = $fields ?: ['*'];
|
$field = $fields ?: ['*'];
|
||||||
} elseif ($except) {
|
} elseif ($except) {
|
||||||
// 字段排除
|
// 字段排除
|
||||||
$fields = isset($this->options['allow_field']) ? $this->options['allow_field'] : $this->getTableInfo($tableName, 'fields');
|
$fields = isset($this->options['allow_field']) ? $this->options['allow_field'] : $this->getTableInfo($tableName ?: $this->options['table'], 'fields');
|
||||||
$field = $fields ? array_diff($fields, $field) : $field;
|
$field = $fields ? array_diff($fields, $field) : $field;
|
||||||
}
|
}
|
||||||
if ($tableName) {
|
if ($tableName) {
|
||||||
|
|||||||
Reference in New Issue
Block a user