腾讯在离线回调
This commit is contained in:
@@ -114,6 +114,9 @@ class Chat extends Model
|
|||||||
//巡乐会抽奖结果推送
|
//巡乐会抽奖结果推送
|
||||||
// BlindBoxTurnTableResult = 1057,
|
// BlindBoxTurnTableResult = 1057,
|
||||||
|
|
||||||
|
//直播群成员在离线状态变更
|
||||||
|
// RoomMemberOffline = 1058,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1127,9 +1127,8 @@ class Room extends Model
|
|||||||
}
|
}
|
||||||
}elseif ($apply_type == 3){
|
}elseif ($apply_type == 3){
|
||||||
$roomInfoStep = db::name('vs_room')->where(['id' => $room_id])->value('step');
|
$roomInfoStep = db::name('vs_room')->where(['id' => $room_id])->value('step');
|
||||||
if($roomInfoStep == 1){
|
$room_pit = db::name('vs_room_pit')->where(['room_id' => $room_id, 'user_id' => $user_id])->find();
|
||||||
//在麦位上 移除用户
|
if($roomInfoStep == 1 || ($roomInfoStep == 2 && ($room_pit['pit_number'] == 9 || $room_pit['pit_number'] == 10))){
|
||||||
$room_pit = db::name('vs_room_pit')->where(['room_id' => $room_id, 'user_id' => $user_id])->find();
|
|
||||||
if (isset($room_pit)) {
|
if (isset($room_pit)) {
|
||||||
model('api/RoomPit')->DownPit($user_id, $room_id, $room_pit['pit_number']);
|
model('api/RoomPit')->DownPit($user_id, $room_id, $room_pit['pit_number']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -919,14 +919,28 @@ class Tencent extends Model
|
|||||||
|
|
||||||
if($quit_room) {
|
if($quit_room) {
|
||||||
foreach ($quit_room as &$v){
|
foreach ($quit_room as &$v){
|
||||||
|
$text['text'] = '杀进程!';
|
||||||
|
$text['user_id'] = $uid;
|
||||||
|
$text['type'] = 0;
|
||||||
|
model('Chat')->sendMsg(1058,$v['room_id'],$text);
|
||||||
model('Room')->quit_room($v['user_id'], $v['room_id'],$v['user_id']);
|
model('Room')->quit_room($v['user_id'], $v['room_id'],$v['user_id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif ($action == 'Login') {
|
} elseif ($action == 'Login') {
|
||||||
Db::name('user')->where('id', $uid)->update(['is_online' => 1, 'updatetime' => time()]);
|
Db::name('user')->where('id', $uid)->update(['is_online' => 1, 'updatetime' => time()]);
|
||||||
|
$room = Db::name('vs_room_visitor')->where('user_id', $uid)->order('id desc')->value('room_id');
|
||||||
|
$text['text'] = '重新上线!';
|
||||||
|
$text['user_id'] = $uid;
|
||||||
|
$text['type'] = 1;
|
||||||
|
model('Chat')->sendMsg(1058,$room,$text);
|
||||||
}elseif ($action == 'Logout'){
|
}elseif ($action == 'Logout'){
|
||||||
Db::name('user')->where('id', $uid)->update(['is_online' => 0, 'updatetime' => time()]);
|
Db::name('user')->where('id', $uid)->update(['is_online' => 0, 'updatetime' => time()]);
|
||||||
|
$room = Db::name('vs_room_visitor')->where('user_id', $uid)->order('id desc')->value('room_id');
|
||||||
|
$text['text'] = '重新上线!';
|
||||||
|
$text['user_id'] = $uid;
|
||||||
|
$text['type'] = 0;
|
||||||
|
model('Chat')->sendMsg(1058,$room,$text);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user