mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
修正 数据表没有主键的情况下 getpk方法错误
This commit is contained in:
@@ -1139,6 +1139,8 @@ class Model
|
|||||||
if (isset($pk)) {
|
if (isset($pk)) {
|
||||||
// 设置主键
|
// 设置主键
|
||||||
$this->pk = count($pk) > 1 ? $pk : $pk[0];
|
$this->pk = count($pk) > 1 ? $pk : $pk[0];
|
||||||
|
} else {
|
||||||
|
$this->pk = null;
|
||||||
}
|
}
|
||||||
// 记录字段类型信息
|
// 记录字段类型信息
|
||||||
$this->fields['_type'] = $type;
|
$this->fields['_type'] = $type;
|
||||||
|
|||||||
Reference in New Issue
Block a user