perf: 年度报告接口 - 增加用户信息字段返回

This commit is contained in:
weifashi 2024-01-08 09:32:28 +08:00
parent 322a855ba2
commit 937bc4ead3

View File

@ -2076,12 +2076,15 @@ class UsersController extends AbstractController
// 跟谁聊天最多(发消息的次数。可以是群、私聊、机器人除外)
'longest_chat_user' => DB::table('web_socket_dialogs as d')
->selectRaw("
{$prefix}d.id,
{$prefix}d.name as dialog_name,
{$prefix}d.type as dialog_type,
{$prefix}d.group_type as dialog_group_type,
{$prefix}m.chat_num
")
{$prefix}d.id,
{$prefix}d.name as dialog_name,
{$prefix}d.type as dialog_type,
{$prefix}d.group_type as dialog_group_type,
{$prefix}m.chat_num,
{$prefix}u.userid,
{$prefix}u.email as user_email,
{$prefix}u.nickname as user_nickname
")
->leftJoinSub(function ($query) use ($user, $year) {
$query->select('web_socket_dialog_msgs.dialog_id', DB::raw('count(*) as chat_num'))
->from('web_socket_dialog_msgs')