This commit is contained in:
2021-03-04 00:04:37 +08:00
parent c588806baf
commit ad70e14f83
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -275,11 +275,11 @@ class ActiveRecord extends BaseActiveRecord
public function toArray(): array
{
$data = $this->_attributes;
foreach ($this->getAnnotation() as $key => $item) {
foreach ($this->getAnnotation('get') as $key => $item) {
if (!isset($data[$key])) {
continue;
}
$data[$key] = call_user_func([$this, $item[1]], $data[$key]);
$data[$key] = call_user_func($item, $data[$key]);
}
$data = array_merge($data, $this->runRelate());
$this->recover();