From 89d0aedd75aa10bf135be22b5665a8b82c81cfdb Mon Sep 17 00:00:00 2001 From: axguowen Date: Sat, 9 Sep 2023 09:08:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=B3=E8=81=94=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E5=8A=A8=E6=80=81=E8=AE=BE=E7=BD=AE=E8=A1=A8=E5=90=8E?= =?UTF-8?q?=E7=BC=80=E4=B9=8B=E5=90=8E=E5=86=99=E5=85=A5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E8=87=AA=E5=8A=A8=E6=B7=BB=E5=8A=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=A1=A8=E5=90=8E=E7=BC=80=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/relation/HasMany.php | 2 +- src/model/relation/MorphMany.php | 2 +- src/model/relation/MorphOne.php | 2 +- src/model/relation/OneToOne.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/model/relation/HasMany.php b/src/model/relation/HasMany.php index 46249555..3cf94453 100644 --- a/src/model/relation/HasMany.php +++ b/src/model/relation/HasMany.php @@ -264,7 +264,7 @@ public function make($data = []): Model // 保存关联表数据 $data[$this->foreignKey] = $this->parent->{$this->localKey}; - return new $this->model($data); + return (new $this->model($data))->setSuffix($this->getModel()->getSuffix()); } /** diff --git a/src/model/relation/MorphMany.php b/src/model/relation/MorphMany.php index ed0dd40a..0290bda1 100644 --- a/src/model/relation/MorphMany.php +++ b/src/model/relation/MorphMany.php @@ -315,7 +315,7 @@ public function make($data = []): Model $data[$this->morphKey] = $this->parent->$pk; $data[$this->morphType] = $this->type; - return new $this->model($data); + return (new $this->model($data))->setSuffix($this->getModel()->getSuffix()); } /** diff --git a/src/model/relation/MorphOne.php b/src/model/relation/MorphOne.php index d63966ff..25c0dd5b 100644 --- a/src/model/relation/MorphOne.php +++ b/src/model/relation/MorphOne.php @@ -284,7 +284,7 @@ public function make($data = []): Model $data[$this->morphKey] = $this->parent->$pk; $data[$this->morphType] = $this->type; - return new $this->model($data); + return (new $this->model($data))->setSuffix($this->getModel()->getSuffix()); } /** diff --git a/src/model/relation/OneToOne.php b/src/model/relation/OneToOne.php index d62692aa..e324ef37 100644 --- a/src/model/relation/OneToOne.php +++ b/src/model/relation/OneToOne.php @@ -224,7 +224,7 @@ public function make($data = []): Model // 保存关联表数据 $data[$this->foreignKey] = $this->parent->{$this->localKey}; - return new $this->model($data); + return (new $this->model($data))->setSuffix($this->getModel()->getSuffix()); } /**