隐藏房间 上麦取消隐藏 功能关闭 点歌删除
This commit is contained in:
@@ -49,6 +49,14 @@ class RoomSong extends BaseCom
|
|||||||
return V($res['code'], $res['msg'], $res['data']);
|
return V($res['code'], $res['msg'], $res['data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//删除歌曲
|
||||||
|
public function del_song(){
|
||||||
|
$room_song_id = input('did');
|
||||||
|
$room_id = input('room_id');
|
||||||
|
$res = model('RoomSong')->del_song($this->uid,$room_song_id,$room_id);
|
||||||
|
return V($res['code'], $res['msg'], $res['data']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//上移歌 $type 1上移 2置顶
|
//上移歌 $type 1上移 2置顶
|
||||||
public function up_song(){
|
public function up_song(){
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class RoomPit extends Model
|
|||||||
//查询房间是否隐藏
|
//查询房间是否隐藏
|
||||||
$is_hide = db::name('vs_room')->where(['id' => $room_id])->value('is_show_room');
|
$is_hide = db::name('vs_room')->where(['id' => $room_id])->value('is_show_room');
|
||||||
if($is_hide == 2){
|
if($is_hide == 2){
|
||||||
db::name('vs_room')->where(['id' => $room_id])->update(['is_show_room' => 1]);
|
// db::name('vs_room')->where(['id' => $room_id])->update(['is_show_room' => 1]);
|
||||||
}
|
}
|
||||||
}elseif ($pit_number == 10) {
|
}elseif ($pit_number == 10) {
|
||||||
$pit_text = '嘉宾麦';
|
$pit_text = '嘉宾麦';
|
||||||
|
|||||||
@@ -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置顶
|
//上移歌 $type 1上移 2置顶
|
||||||
public function up_song($user_id,$room_song_id,$type=1){
|
public function up_song($user_id,$room_song_id,$type=1){
|
||||||
//查询当前数据的信息
|
//查询当前数据的信息
|
||||||
|
|||||||
Reference in New Issue
Block a user