mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
改进Query类的field方法
This commit is contained in:
@@ -733,11 +733,11 @@ class Query
|
|||||||
}
|
}
|
||||||
if (true === $field) {
|
if (true === $field) {
|
||||||
// 获取全部字段
|
// 获取全部字段
|
||||||
$fields = !empty($this->allowField) && $this->getTable() == $tableName ? $this->allowField : $this->getTableInfo($tableName ?: (isset($this->options['table']) ? $this->options['table'] : ''), 'fields');
|
$fields = !empty($this->allowField) && ('' == $tableName || $this->getTable() == $tableName) ? $this->allowField : $this->getTableInfo($tableName ?: (isset($this->options['table']) ? $this->options['table'] : ''), 'fields');
|
||||||
$field = $fields ?: ['*'];
|
$field = $fields ?: ['*'];
|
||||||
} elseif ($except) {
|
} elseif ($except) {
|
||||||
// 字段排除
|
// 字段排除
|
||||||
$fields = !empty($this->allowField) && $this->getTable() == $tableName ? $this->allowField : $this->getTableInfo($tableName ?: (isset($this->options['table']) ? $this->options['table'] : ''), 'fields');
|
$fields = !empty($this->allowField) && ('' == $tableName || $this->getTable() == $tableName) ? $this->allowField : $this->getTableInfo($tableName ?: (isset($this->options['table']) ? $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