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