mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进模型类的checkallowfield方法
This commit is contained in:
@@ -1094,19 +1094,16 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
|
||||
protected function checkAllowField($auto = [])
|
||||
{
|
||||
if (!empty($this->field)) {
|
||||
if (!empty($this->origin)) {
|
||||
$this->field = array_keys($this->origin);
|
||||
$field = $this->field;
|
||||
} elseif (true === $this->field) {
|
||||
$this->field = $this->getQuery()->getTableInfo('', 'fields');
|
||||
$field = $this->field;
|
||||
} else {
|
||||
$field = array_merge($this->field, $auto);
|
||||
}
|
||||
if (true === $this->field) {
|
||||
$this->field = $this->getQuery()->getTableInfo('', 'fields');
|
||||
$field = $this->field;
|
||||
} elseif (!empty($this->field)) {
|
||||
$field = array_merge($this->field, $auto);
|
||||
} else {
|
||||
$field = [];
|
||||
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user