点唱房
This commit is contained in:
@@ -92,7 +92,8 @@ class SingerSong extends BaseCom
|
||||
return V(0, '请选择房间');
|
||||
}
|
||||
//用户ID
|
||||
$reslut = model('SingerSong')->getSong($this->uid, $room_id);
|
||||
$user_id = input('user_id', 0);
|
||||
$reslut = model('SingerSong')->getSong($user_id, $room_id);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
|
||||
@@ -631,7 +631,7 @@ class Room extends Model
|
||||
$user_pit = 0;
|
||||
$pit_list = [];
|
||||
$cp_users = null;
|
||||
if($room['type_id'] == 1 || $room['type_id'] == 3 || $room['type_id'] == 4 || $room['type_id'] == 7 || $room['type_id'] == 8) {//1点唱,3男神,4女神
|
||||
if($room['type_id'] == 1 || $room['type_id'] == 3 || $room['type_id'] == 4 || $room['type_id'] == 7 || $room['type_id'] == 8 || $room['type_id'] == 9) {//1点唱,3男神,4女神
|
||||
if($room['label_id'] == 2){//K歌
|
||||
$song = $this->get_song_info($room_id,$user_id);
|
||||
$song_list = $song['song_user_info'];
|
||||
|
||||
@@ -63,7 +63,7 @@ class RoomPit extends Model
|
||||
$FromUserInfo['dress'] = model('Decorate')->user_decorate_detail($user_id,1);
|
||||
$FromUserInfo['charm'] = db::name('vs_room_user_charm')->where(['user_id' => $user_id,'room_id' => $room_id])->value('charm');
|
||||
$Nobility = model('api/Nobility')->getUserNobilityInfo($user_id);
|
||||
$FromUserInfo['nobility_info'] = $Nobility;
|
||||
// $FromUserInfo['nobility_info'] = $Nobility;
|
||||
$FromUserInfo['mic_cycle'] = model('api/Decorate')->user_decorate_detail($user_id,3);
|
||||
$FromUserInfo['nobility_image'] = $Nobility['play_image'];
|
||||
$FromUserInfo['nickname_color'] = $Nobility['nick_name_color'];
|
||||
|
||||
@@ -94,12 +94,25 @@ class SingerSong extends Model
|
||||
*/
|
||||
public function getSong($user_id, $room_id)
|
||||
{
|
||||
//查询当前房间内麦位上的歌手
|
||||
$room_singer = db::name('vs_room_pit')->where(['room_id' => $room_id, 'pit_number' => ['<',9]])->column('user_id');
|
||||
if ($room_singer) {
|
||||
foreach ($room_singer as $v){
|
||||
$res = db::name('vs_singer_song')->where(['user_id' => $v])->find();
|
||||
if($user_id > 0){
|
||||
$res = db::name('vs_singer_song')->where(['user_id' => $user_id])->select();
|
||||
}else{
|
||||
//查询当前房间内麦位上的歌手
|
||||
$room_singer = db::name('vs_room_pit')->where(['room_id' => $room_id, 'pit_number' => ['<',9]])->column('user_id');
|
||||
if ($room_singer) {
|
||||
$res = db::name('vs_singer_song')->where(['user_id' => ['in', $room_singer]])->select();
|
||||
}else{
|
||||
$res = [];
|
||||
}
|
||||
}
|
||||
if ($res) {
|
||||
foreach ($res as $k => $v) {
|
||||
$res[$k]['gift_name'] = db::name('vs_gift')->where(['gid' => $v['gift_id']])->value('gift_name');
|
||||
}
|
||||
return ['code' => 1, 'msg' => '获取成功', 'data' => $res];
|
||||
} else {
|
||||
return ['code' => 0, 'msg' => '暂无数据'];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user