th5怎么在model设置要返回的字段
public function fields()
{
return [
'actor_id',
'area_id',
'actor_name',
'avatar' => function() {
return $this->avatar->toUrl();
},
'type' => function() {
return $this->type;
},
'type_name' => function() {
return self::$actionMap[$this->type];
}
];
}
类似这种的