This commit is contained in:
2025-10-20 09:59:39 +08:00
parent e73091cdf3
commit a4858d47fc
2834 changed files with 6510 additions and 438740 deletions

View File

@@ -18,9 +18,14 @@ class TenSeconds
echo "房间在线人数:\n";
$this->auction_end_notice();//拍卖房结束提醒
echo "\n";
//清理切后台超过5分钟的用户
echo "清理切后台超过5分钟的用户\n";
$this->clear_offline_user();
echo "\n";
}
//在线人数
protected function auction_end_notice()
{
$auction_list = db::name('vs_room')->field('id')->where(['room_status'=>1,'apply_status' => 2,'type_id' =>['<>',6]])->select();
@@ -40,17 +45,6 @@ class TenSeconds
$data_number++;
}
}
// else{
// if($on_pit_num > 0){
// $text = [
// 'online_number' => $on_pit_num,
// 'room_id' => $value['id'],//接受房间id
// ];
// model('api/Chat')->sendMsg(1036,$value['id'],$text);
// $data_number++;
// }
// }
$data_count++;
}
}
@@ -58,4 +52,18 @@ class TenSeconds
echo "房间在线人数>0 的总共" . $data_number . "条数据\n";
}
//清理切后台超过5分钟的用户
protected function clear_offline_user()
{
$time = time() - 300;
$user_list = db::name('vs_user_in_room_bg')->where('updatetime', '<=', $time)->select();
if($user_list){
foreach ($user_list as $v){
//删除
db::name('vs_user_in_room_bg')->delete($v['id']);
model('api/Room')->quit_room($v['user_id'], $v['room_id'],$v['user_id'],2);
}
}
}
}