From 42283ce525c4c13a0975467cb838b80719ec3569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 22 Jan 2021 19:16:32 +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 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index 47da041a..018d4709 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -313,11 +313,9 @@ class ActiveRecord extends BaseActiveRecord { $data = $this->_attributes; foreach ($this->getAnnotation() as $key => $item) { - if (!$this->hasAnnotation($key)) { - continue; + if ($this->hasAnnotation($key)) { + $data[$key] = call_user_func([$this, $item[1]], $data[$key] ?? ''); } - $item = [$this, $item[1]]; - $data[$key] = call_user_func($item, $data[$key] ?? ''); } return array_merge($data, $this->runRelate()); }