测试代码提交

This commit is contained in:
2025-12-17 10:31:41 +08:00
parent 794ea56b09
commit a462d63bc5
2 changed files with 26 additions and 4 deletions

View File

@@ -352,7 +352,7 @@ class Test
}
public function calc_7_balances(){
//当前平台结余
for($i=1;$i<=16;$i++){
for($i=1;$i<=15;$i++){
$time = strtotime('2025-12-'.$i);
$all_earnings = db::name('user_wallet')->sum('earnings');
$all_income = db::name('vs_user_money_log')
@@ -433,4 +433,26 @@ class Test
echo "任务历史数据补发完成 用户总数:".count($room_list). " \n";
}
public function clear_room_offline_user() {
echo "开始清除房间离线用户 \n";
$room = db::name('vs_room_visitor')->where(['is_online' => 2])->select();
$res_i = 0;
if($room){
foreach ($room as $value) {
$time = time() - $value['updatetime'];
if($time > 86400){
$re = model('api/Room')->quit_room($value['user_id'], $value['room_id'],$value['user_id']);
if($re['code'] != 1){
echo "清除房间离线用户失败:".$value['user_id']."---".$re['msg']."\n";
}else{
echo "清除房间离线用户成功:".$value['user_id']."\n";
$res_i ++;
}
}
}
}
echo "清除房间离线用户完成 (".$res_i.") \n";
}
}