This commit is contained in:
2021-03-04 15:17:25 +08:00
parent 5a237cdd77
commit 09c22bd878
2 changed files with 30 additions and 16 deletions
+2 -2
View File
@@ -268,11 +268,11 @@ class ActiveRecord extends BaseActiveRecord
public function toArray(): array
{
$data = $this->_attributes;
foreach ($this->getAnnotation('get') as $key => $item) {
foreach ($this->getAnnotation(self::ANNOTATION_GET) as $key => $item) {
if (!isset($data[$key])) {
continue;
}
$data[$key] = call_user_func($item, $data[$key]);
$data[$key] = $this->runAnnotation($key, $data[$key]);
}
$data = array_merge($data, $this->runRelate());
$this->recover();