From 83c49c6049b33ea488317f19e4ca0609189e92cd Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sun, 4 Apr 2021 17:47:13 +0800 Subject: [PATCH] modify --- Database/Base/BaseActiveRecord.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index 873516fd..a02bf3ec 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -391,7 +391,13 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess */ public function getAttributes(): array { - return $this->_attributes; + $data = $this->_attributes; + foreach ($this->getAnnotation() as $key => $item) { + if (!isset($data[$key])) continue; + + $data[$key] = $this->runAnnotation($key, $data[$key] ?? null); + } + return $data; } /**