From 9fe4c7fd50c7cbdafc393b1ef72e28dc34b69e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 28 Feb 2022 14:40:13 +0800 Subject: [PATCH] modify plugin name --- Model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Model.php b/Model.php index 40d0db9..047c274 100644 --- a/Model.php +++ b/Model.php @@ -116,7 +116,7 @@ class Model extends Base\Model /** @var static $select */ $select = static::query()->where($condition)->first(); if (empty($select)) { - $select = duplicate(static::class); + $select = new static(); $select->attributes = $attributes; if (!$select->save()) { throw new Exception($select->getLastError()); @@ -141,7 +141,7 @@ class Model extends Base\Model /** @var static $select */ $select = static::query()->where($condition)->first(); if (empty($select)) { - $select = duplicate(static::class); + $select = new static(); } $select->attributes = $attributes; if (!$select->save()) {