From 52d41e9e36b84d3f4b548e8155fd56cba7281fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Sat, 3 Jan 2026 11:31:23 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BA=A4=E5=8F=8B=E7=BB=93=E6=9D=9F=20?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Friend.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/api/model/Friend.php b/application/api/model/Friend.php index 580d71fe..a98f9475 100644 --- a/application/api/model/Friend.php +++ b/application/api/model/Friend.php @@ -123,6 +123,7 @@ class Friend extends Model }else{ // 修改当前交友阶段 db::name('vs_room')->where(['id' => $room_id])->update(['step' => $step,'updatetime' => time()]); + db::name('vs_user_friending')->where(['id' => $id])->update(['update_time' => time()]); } }else{ $step = 1;//结束下一轮 From 4a254d9f2883e221cee42cb743ec86291ede6d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Sat, 3 Jan 2026 12:55:04 +0800 Subject: [PATCH 2/4] =?UTF-8?q?k=E6=AD=8C=E6=88=BF=20=20=E6=9C=89=E5=B7=B2?= =?UTF-8?q?=E7=82=B9=E6=AD=8C=E6=9B=B2=20=20=E4=BD=86=E6=98=AF=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=AD=A3=E5=9C=A8=E6=BC=94=E5=94=B1=E7=9A=84=E6=AD=8C?= =?UTF-8?q?=20=20=E7=BD=AE=E9=A1=B6=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/RoomSong.php | 73 ++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 8 deletions(-) diff --git a/application/api/model/RoomSong.php b/application/api/model/RoomSong.php index ff9c936d..67053ddf 100644 --- a/application/api/model/RoomSong.php +++ b/application/api/model/RoomSong.php @@ -175,7 +175,7 @@ class RoomSong extends Model public function song($room_id,$user_id,$song_code,$song_name,$singer,$poster,$duration){ $action = 0;//初始值,1-申请点歌,2-切歌,3-下一首歌曲变化,4-拒绝申请点歌 //查询当前房间中的场次状态 - $times_status = db::name('vs_room_song')->where('room_id',$room_id)->field('times,times_status')->order('did desc')->find(); + $times_status = db::name('vs_room_song')->where('room_id',$room_id)->field('times,times_status')->order('sort desc')->find(); if(!empty($times_status)){//已经有歌曲 if($times_status['times_status'] == 2){//这一场次结束了 $data['sort'] = 10000;//排序,新场次第一首歌 @@ -261,13 +261,16 @@ class RoomSong extends Model //把这个信息存储到redis Cache::set("api:room:song:nextInfo:" . $room_id, $did); } - $text = [ - 'action' => $action, - 'total' => $total, - 'songInfo' => $nowInfo, - 'nextInfo' => $nextInfo - ]; - model('Chat')->sendMsg(1013,$room_id,$text); + if($action){ + $text = [ + 'action' => $action, + 'total' => $total, + 'songInfo' => $nowInfo, + 'nextInfo' => $nextInfo + ]; + model('Chat')->sendMsg(1013,$room_id,$text); + } + //1-禁麦位,2-清空消息,3-清空魅力值,4-加入黑名单,5-踢出房间,6-关闭麦克风,7-申请上麦,8-同意上麦,9-拒绝上麦,10-点歌,11-开启PK', model('Room')->room_operation_record($user_id,$room_id,10,0,0,$did); return ['code'=>1,'msg'=>'申请成功','data'=>null]; @@ -328,6 +331,7 @@ class RoomSong extends Model if($sort_up[0]['did'] == $room_song_id){ return ['code'=>0,'msg'=>'已经是第一首歌了','data'=>null]; } + if($type == 1){ //上移 foreach ($sort_up as $k=>$v){ if($v['did'] == $room_song_id){ @@ -347,8 +351,61 @@ class RoomSong extends Model if(!$res){ return ['code'=>0,'msg'=>'操作失败','data'=>null]; } + $data = db::name('vs_room_song')->where(['room_id' => $sort['room_id'],'status' => 1,'times' =>$sort['times'],'times_status' => 1]) ->order('sort desc')->select(); + + //查询当前是否有正在演唱的歌曲 + $now_room_song = db::name('vs_room_song') ->where('room_id',$sort['room_id']) + ->where('times',$sort['times']) + ->where('status',2) + ->find(); + if(empty($now_room_song)){ + $total = db::name('vs_room_song') + ->where(['room_id' => $sort['room_id'],'status' => 1,'times_status' => 1]) + ->count(); + $nowInfo = [ + 'did' => $data[0]['did'], + 'song_code' => $data[0]['song_code'], + 'song_name' => $data[0]['song_name'], + 'singer' => $data[0]['singer'], + 'poster' => $data[0]['poster'], + 'duration' => $data[0]['duration'], + 'user_id' => $data[0]['user_id'], + 'dress' => model('Decorate')->user_decorate_detail($data[0]['user_id'], 1), + 'nickname' => db::name('user')->where('id',$data[0]['user_id'])->value('nickname'), + 'avatar' => db::name('user')->where('id',$data[0]['user_id'])->value('avatar'), + 'charm' => db::name('vs_room_user_charm')->where(['user_id' => $data[0]['user_id'],'room_id' => $sort['room_id']])->value('charm'), + ]; + if(isset($data[1]['did'])){ + $nextInfo = [ + 'did' => $data[1]['did'], + 'song_code' => $data[1]['song_code'], + 'song_name' => $data[1]['song_name'], + 'singer' => $data[1]['singer'], + 'poster' => $data[1]['poster'], + 'duration' => $data[1]['duration'], + 'user_id' => $data[1]['user_id'], + 'dress' => model('Decorate')->user_decorate_detail($data[1]['user_id'], 1), + 'nickname' => db::name('user')->where('id',$data[1]['user_id'])->value('nickname'), + 'avatar' => db::name('user')->where('id',$data[1]['user_id'])->value('avatar'), + 'charm' => db::name('vs_room_user_charm')->where(['user_id' =>$data[1]['user_id'],'room_id' => $sort['room_id']])->value('charm'), + ]; + }else{ + $nextInfo = null; + } + + $text = [ + 'action' => 2, + 'total' => $total, + 'songInfo' => $nowInfo, + 'nextInfo' => $nextInfo + ]; + model('Chat')->sendMsg(1013,$sort['room_id'],$text); + Cache::set("api:room:song:nextInfo:" . $sort['room_id'],$data[0]['did']); + return ['code'=>1,'msg'=>'操作成功','data'=>$data]; + } + $did = Cache::get("api:room:song:nextInfo:" . $sort['room_id']); //歌曲移动后,下一首播放歌曲信息 发生改变 推送给前端 if($data[0]['did'] != $did){ From fce818807e63a4fd88b38925c768bf6852d223fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Sat, 3 Jan 2026 13:49:50 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=B6=88=E6=81=AF=20=E5=AD=97=E6=AE=B5=E5=87=8F=E5=B0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/UserMessage.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/api/model/UserMessage.php b/application/api/model/UserMessage.php index 694fd0d5..84a493c7 100644 --- a/application/api/model/UserMessage.php +++ b/application/api/model/UserMessage.php @@ -142,6 +142,7 @@ class UserMessage extends Model //获取消息 $list = db::name('system_message') + ->field('id,type,title,content,url,admin_id,image,createtime,room_id,user_id,remind_type,status,updatetime') ->where($where) ->where('FIND_IN_SET(:user_id, receiving_id)', ['user_id' => $uid]) ->order('id desc') From 630e67693f1ab5a3d5f392c560b52f9190b42fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Sat, 3 Jan 2026 14:17:47 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=B0=81=E7=A6=81=20=20?= =?UTF-8?q?=E8=AE=A9=E7=99=BB=E5=BD=95=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/adminapi/controller/User.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/adminapi/controller/User.php b/application/adminapi/controller/User.php index 6015929e..af6d76dc 100644 --- a/application/adminapi/controller/User.php +++ b/application/adminapi/controller/User.php @@ -9,6 +9,7 @@ use think\Db; use think\Hook; use think\Session; use think\Validate; +use app\common\library\Token as TokenLib; /** * 后台首页 @@ -272,6 +273,9 @@ class User extends adminApi Db::name('block')->where($map)->delete(); Db::name('sms_error')->where(['mobile' => $user_info['mobile']])->delete(); } + $token = db::name('user_token')->where('user_id', $user_id)->value('token'); + // 删除这个Token,使其失效 + TokenLib::delete($token); return V(1,"成功", null); }