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];