练歌房 最后一首歌 切歌后处理

This commit is contained in:
2025-12-24 09:56:03 +08:00
parent 53e5e52203
commit 270714928b

View File

@@ -114,10 +114,10 @@ class RoomSong extends Model
return ['code' => 0, 'msg' => '请先结束签约后在修改房间类型', 'data' => null];
}
$res1 = db::name('vs_room')->where('id',$room_id)->where(['label_id'=>2,'is_song'=>3])->find();
if($res1){
return ['code'=>0,'msg'=>'点歌中!请稍后再试!','data'=>null];
}
// $res1 = db::name('vs_room')->where('id',$room_id)->where(['label_id'=>2,'is_song'=>3])->find();
// if($res1){
// return ['code'=>0,'msg'=>'点歌中!请稍后再试!','data'=>null];
// }
if($type == 1){//1同意 2拒绝
$res2 = db::name('vs_room')->where('id',$room_id)->field('room_up_pit_type')->find();
if($res2['room_up_pit_type'] == 2){
@@ -376,6 +376,13 @@ class RoomSong extends Model
'nextInfo' => null
];
model('Chat')->sendMsg(1013,$room_id,$text);
db::name('vs_room_song')->where(['room_id' => $room_id,'times_status' => 1,'status' => 1])->update(['status'=>4]);
if(db::name('vs_room_song')->where(['room_id' => $room_id,'times_status' => 1,'status' => 2])->find()){
db::name('vs_room_song')->where(['room_id' => $room_id,'times_status' => 1,'status' => 2])->update(['status'=>3]);
}
if(db::name('vs_room_song')->where('room_id',$room_id)->where(['times_status'=>1])->find()){
db::name('vs_room_song')->where('room_id',$room_id)->update(['times_status'=>2]);
}
return ['code'=>0,'msg'=>'已经是最后一首歌了','data'=>null];
}
$total = db::name('vs_room_song')