新增聊天室状态与功能快捷菜单
This commit is contained in:
+1
-19
@@ -19,25 +19,7 @@ Broadcast::channel('room.{roomId}', function ($user, $roomId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$superLevel = (int) \App\Models\Sysparam::getValue('superlevel', '100');
|
||||
// 预加载当前在职职务,供右侧在线名单直接显示职务图标与名称。
|
||||
$activePosition = $user->activePosition()->with('position.department')->first();
|
||||
$position = $activePosition?->position;
|
||||
|
||||
return [
|
||||
'id' => $user->id,
|
||||
'username' => $user->username,
|
||||
'user_level' => $user->user_level,
|
||||
'sex' => $user->sex,
|
||||
'headface' => $user->headface, // 通过 accessor 读取 usersf,默认 1.gif
|
||||
'vip_icon' => $user->vipIcon(),
|
||||
'vip_name' => $user->vipName(),
|
||||
'vip_color' => $user->isVip() ? ($user->vipLevel?->color ?? '') : '',
|
||||
'is_admin' => $user->user_level >= $superLevel,
|
||||
'position_icon' => $position?->icon ?? '',
|
||||
'position_name' => $position?->name ?? '',
|
||||
'department_name' => $position?->department?->name ?? '',
|
||||
];
|
||||
return app(\App\Services\ChatUserPresenceService::class)->build($user);
|
||||
});
|
||||
|
||||
// 用户私有频道鉴权(好友通知:FriendAdded / FriendRemoved / BannerNotification)
|
||||
|
||||
Reference in New Issue
Block a user