优化 会员页面;
This commit is contained in:
@@ -76,12 +76,21 @@ class VipPresenceService
|
||||
? $this->vipService->getJoinMessage($user)
|
||||
: $this->vipService->getLeaveMessage($user);
|
||||
|
||||
// 只有在等级允许自定义时,才允许覆盖默认特效。
|
||||
$customEffect = $type === 'join'
|
||||
? $user->custom_join_effect
|
||||
: $user->custom_leave_effect;
|
||||
|
||||
if (! $user->canCustomizeVipPresence()) {
|
||||
$customEffect = null;
|
||||
}
|
||||
|
||||
return [
|
||||
'enabled' => true,
|
||||
'type' => $type,
|
||||
'text' => $customMessage ?: $templateMessage,
|
||||
'color' => $vipLevel->color ?: '#f59e0b',
|
||||
'effect' => $type === 'join' ? $this->normalizeEffect($vipLevel->joinEffectKey()) : $this->normalizeEffect($vipLevel->leaveEffectKey()),
|
||||
'effect' => $this->normalizeEffect($customEffect ?: ($type === 'join' ? $vipLevel->joinEffectKey() : $vipLevel->leaveEffectKey())),
|
||||
'banner_style' => $type === 'join' ? $vipLevel->joinBannerStyleKey() : $vipLevel->leaveBannerStyleKey(),
|
||||
'level_name' => $vipLevel->name,
|
||||
'icon' => $vipLevel->icon,
|
||||
|
||||
Reference in New Issue
Block a user