From 51edab2358c621bdb64e3cba2a25d8c1aad7fb8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 19 Jan 2021 19:18:07 +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, 3 insertions(+), 3 deletions(-) diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index 07e5436f..63a6ddd3 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -313,12 +313,12 @@ class ActiveRecord extends BaseActiveRecord $attributes = Snowflake::app()->getAttributes(); $callback = $attributes->getByClass(static::class); - var_dump($callback); - $data = $this->_attributes; foreach ($callback as $key => $item) { - $result = call_user_func($item['handler'], $data[$key]); foreach ($item['attributes'] as $attribute) { + + $result = call_user_func($item['handler'], $data[$attribute]); + $data[$attribute] = $result; } }