头像与姓名

This commit is contained in:
2025-08-11 10:58:03 +08:00
parent f45534da7d
commit f704f4e01a
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -29,7 +29,9 @@ class ConversationService
foreach ($value['attachment'] as $k => $attachment) {
$value['attachment'][$k]['storage_path_full'] = (!empty($attachment))?$ossservice->generatePrivateUrl($attachment['storage_path']):'';
}
$value['user_name'] = User::where('id', $value['user_id'])->value('name');
$user = User::where('id', $value['user_id'])->first();
$value['user_name'] = $user?->name;
$value['user_avatar'] = $user?->avatar;
$result[$key] = $value;
}
return $result;