Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
2026-01-03 14:48:48 +08:00
4 changed files with 71 additions and 8 deletions

View File

@@ -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);
}

View File

@@ -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;//结束下一轮

View File

@@ -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){

View File

@@ -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')