From 03bf140f85cb9508843d0077634c99d130484d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Mon, 17 Nov 2025 14:56:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E9=80=81=E4=BF=A1=E6=81=AF=E5=8F=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/SingerSong.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/application/api/model/SingerSong.php b/application/api/model/SingerSong.php index 8f2a1b5..27e516c 100644 --- a/application/api/model/SingerSong.php +++ b/application/api/model/SingerSong.php @@ -201,9 +201,22 @@ class SingerSong extends Model 'song_info' => $song_info ]; model('Chat')->sendMsg(1070,$room_id,$song_info_data); + }elseif ($song_info_count == 2){ + //给前端推送下首歌曲信息 + $next_song_info = db::name('vs_song_log')->where(['id' => $result])->find(); + $next_song_info['boss_nickname'] = db::name('user')->where(['id' => $next_song_info['user_id']])->value('nickname'); + $next_song_info['boss_avatar'] = db::name('user')->where(['id' => $next_song_info['user_id']])->value('avatar'); + $singer_song = db::name('vs_singer_song')->where(['id' => $next_song_info['singer_song_id']])->find(); + $next_song_info['singer_nickname'] = db::name('user')->where(['id' => $singer_song['user_id']])->value('nickname'); + $next_song_info['singer_avatar'] = db::name('user')->where(['id' => $singer_song['user_id']])->value('avatar'); + $next_song_info['song_name'] = $singer_song['song_name']; + + $data = [ + 'text' => '房间下一首演唱歌曲变化', + 'next_song_info' => $next_song_info + ]; + model('Chat')->sendMsg(1071,$next_song_info['room_id'],$data); } - - return ['code' => 1, 'msg' => '点歌成功', 'data' => null]; } else { return ['code' => 0, 'msg' => $res['msg'], 'data' => null];