From 22ce82d0f633355209cfaa7c265830219f19342d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 18 Nov 2020 15:05:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/ActiveRecord.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index 515a198f..8e9a0be5 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -115,14 +115,14 @@ class ActiveRecord extends BaseActiveRecord */ public static function findOrCreate(array $condition, array $attributes = []) { - $select = static::find()->where($condition)->first(); + $select = self::find()->where($condition)->first(); if (!empty($select)) { return $select; } if (empty($attributes)) { return \logger()->addError(FIND_OR_CREATE_MESSAGE, 'mysql'); } - $select = new static(); + $select = new self(); $select->attributes = $attributes; if (!$select->save()) { throw new Exception($select->getLastError());