From 6ff23d14e168052753525cd636710c078a7ec4c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 27 Apr 2021 18:37:15 +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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index c592b055..ef8d3287 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -305,16 +305,16 @@ class ActiveRecord extends BaseActiveRecord */ public function toArray(): array { - return $this->_attributes; + $data = $this->_attributes; $lists = $this->getAnnotation(self::GET); foreach ($lists as $key => $item) { - $data[$key] = call_user_func([$this, $item], $data[$key] ?? null); + $data[$key] = call_user_func([$this,$item],$data[$key] ?? null); } - return array_merge($data, $this->runRelate()); + $data = array_merge($data, $this->runRelate()); -// $class = Snowflake::app()->getChannel(); -// $class->push($this, static::class); + $class = Snowflake::app()->getChannel(); + $class->push($this, static::class); return $data; }