mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
修正 主键获取的BUG
This commit is contained in:
@@ -1120,7 +1120,7 @@ class Model
|
||||
{
|
||||
if ($this->fields) {
|
||||
$fields = $this->fields;
|
||||
unset($fields['_type']);
|
||||
unset($fields['_type'], $fields['_pk']);
|
||||
return $fields;
|
||||
} else {
|
||||
$tableName = $this->getTableName();
|
||||
@@ -1144,12 +1144,14 @@ class Model
|
||||
}
|
||||
// 记录字段类型信息
|
||||
$this->fields['_type'] = $type;
|
||||
$this->fields['_pk'] = $this->pk;
|
||||
APP_DEBUG && Cache::set($guid, $this->fields);
|
||||
$fields = $this->fields;
|
||||
} else {
|
||||
$this->fields = $fields;
|
||||
$this->pk = $fields['_pk'];
|
||||
}
|
||||
unset($fields['_type']);
|
||||
unset($fields['_type'], $fields['_pk']);
|
||||
return $fields;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user