调整粉丝列表接口
parent
d5fe247d6f
commit
e6d399987c
|
|
@ -18,7 +18,8 @@ class FansResource extends JsonResource
|
||||||
'phone' => $this->phone,
|
'phone' => $this->phone,
|
||||||
'nickname' => (string) $this->whenLoaded('userInfo', $this->userInfo->nickname, ''),
|
'nickname' => (string) $this->whenLoaded('userInfo', $this->userInfo->nickname, ''),
|
||||||
'avatar' => (string) $this->whenLoaded('userInfo', $this->userInfo->avatar, ''),
|
'avatar' => (string) $this->whenLoaded('userInfo', $this->userInfo->avatar, ''),
|
||||||
'value' => (string) $this->whenLoaded('userInfo', $this->userInfo->growth_value + $this->userInfo->group_sales_value, 0),
|
'value' => (string) $this->whenLoaded('userInfo', $this->userInfo->growth_value, 0),
|
||||||
|
'level_name' => (string) $this->whenLoaded('userInfo', $this->userInfo->agent_level_name, '未知'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -208,4 +208,9 @@ class UserInfo extends Model
|
||||||
{
|
{
|
||||||
return static::$agentLevelKeys[$this->agent_level] ?? 'unknown';
|
return static::$agentLevelKeys[$this->agent_level] ?? 'unknown';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getAgentLevelNameAttribute(): string
|
||||||
|
{
|
||||||
|
return static::$agentLevelTexts[$this->agent_level] ?? '未知';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue