测试清除房间首页热度值

This commit is contained in:
2026-01-20 17:20:19 +08:00
parent 973953aae6
commit cb8b6798b9

View File

@@ -25,8 +25,13 @@ class TenSeconds
// echo "\n";
//房间营业时间结束后把用户踢出房间
echo "房间营业时间结束后把用户踢出房间\n";
// echo "房间营业时间结束后把用户踢出房间\n";
// $this->room_end_kick_user();
// echo "\n";
echo "清除房间热度值:\n";
$this->clear_room_today_hot_value();//整点以后房间热度值清零
echo "\n";
}
@@ -61,5 +66,25 @@ class TenSeconds
}
/*
* 整点以后房间热度值清零
* 配置:
*/
public function clear_room_today_hot_value() {
$where = [];
$where['delete_time'] = 0;
$where['is_show_room'] = 1;
$room = db::name('vs_room')->where($where)->select();
echo date('Y-m-d H:i:s').' 开始清零:'.count($room)."\n";
foreach ($room as $key => $value) {
$data = [
'today_hot_value' => 0,
];
db::name('vs_room')->where(['id' => $value['id']])->update($data);
}
echo date('Y-m-d H:i:s').' 完成'."\n";
}
}