隐藏房间 上麦取消隐藏 功能关闭 点歌删除
This commit is contained in:
@@ -291,6 +291,29 @@ class RoomSong extends Model
|
||||
}
|
||||
|
||||
|
||||
//删除已点歌曲
|
||||
public function del_song($user_id,$did,$room_id){
|
||||
//查询当前用户是否是在9号麦的主持
|
||||
$is_host = db::name('vs_room_pit')->where(['user_id' => $user_id,'room_id' => $room_id,'pit_number' =>9])->find();
|
||||
if(!$is_host){
|
||||
return ['code'=>0,'msg'=>'您没有权限操作','data'=>null];
|
||||
}
|
||||
$is_song = db::name('vs_room_song')->where(['did' => $did,'status' => 2])->find();
|
||||
if($is_song){
|
||||
return ['code'=>0,'msg'=>'演唱中不能删除','data'=>null];
|
||||
}
|
||||
$next_song = Cache::get("api:room:song:nextInfo:" . $room_id);
|
||||
if($did == $next_song){
|
||||
return ['code'=>0,'msg'=>'下一首播放歌曲不能删除','data'=>null];
|
||||
}
|
||||
$res = db::name('vs_room_song')->where(['did' => $did,'status' => 1])->delete();
|
||||
if(!$res){
|
||||
return ['code'=>0,'msg'=>'操作失败','data'=>null];
|
||||
}
|
||||
return ['code'=>1,'msg'=>'操作成功','data'=>null];
|
||||
}
|
||||
|
||||
|
||||
//上移歌 $type 1上移 2置顶
|
||||
public function up_song($user_id,$room_song_id,$type=1){
|
||||
//查询当前数据的信息
|
||||
|
||||
Reference in New Issue
Block a user