mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进聚合模型 主表的主键名和附表的关联键名一致导致关联数据写入错误的问题
This commit is contained in:
@@ -245,7 +245,7 @@ class Merge extends Model
|
||||
|
||||
// 写入附表数据
|
||||
$source = $this->data;
|
||||
if ($insertId && is_string($pk) && isset($source[$pk])) {
|
||||
if ($insertId && is_string($pk) && isset($source[$pk]) && $this->fk != $pk) {
|
||||
unset($source[$pk]);
|
||||
}
|
||||
foreach (static::$relationModel as $key => $model) {
|
||||
|
||||
Reference in New Issue
Block a user