框架升级及修复升级后的bug

This commit is contained in:
Dev
2026-10-16 18:13:09 +08:00
parent dafb0c96c0
commit 2d342bcbd7
537 changed files with 49836 additions and 40933 deletions
@@ -38,6 +38,19 @@ trait Backend
return $params;
}
/**
* Exclude model primary key fields from submitted update data
* @param $params
* @return array
*/
protected function preExcludePrimaryKey($params)
{
foreach ((array)$this->model->getPk() as $key) {
unset($params[$key]);
}
return $params;
}
/**
* 查看
*
@@ -156,6 +169,7 @@ trait Backend
$this->error(__('Parameter %s can not be empty', ''));
}
$params = $this->preExcludeFields($params);
$params = $this->preExcludePrimaryKey($params);
$result = false;
Db::startTrans();
try {