清理房间离线超过1小时的用户
This commit is contained in:
@@ -50,7 +50,6 @@ class Cron
|
|||||||
//每天执行
|
//每天执行
|
||||||
/*
|
/*
|
||||||
* 清除房间热度值
|
* 清除房间热度值
|
||||||
* 清除房间离线超24小时的用户
|
|
||||||
* 系统降身价
|
* 系统降身价
|
||||||
* 过期验证码删除
|
* 过期验证码删除
|
||||||
*/
|
*/
|
||||||
@@ -87,9 +86,10 @@ class Cron
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//房间小时榜发礼物(每小时执行一次)
|
//每小时执行一次
|
||||||
/*
|
/*
|
||||||
* 小时榜 开始发礼物
|
* 小时榜 开始发礼物
|
||||||
|
* 清除房间离线超1小时的用户
|
||||||
*/
|
*/
|
||||||
public function RoomHourRanking(){
|
public function RoomHourRanking(){
|
||||||
$cron = new \app\cron\controller\RoomHourRanking();
|
$cron = new \app\cron\controller\RoomHourRanking();
|
||||||
|
|||||||
@@ -19,10 +19,6 @@ class DaySeconds
|
|||||||
$this->clear_room_today_hot_value();//0点以后房间热度值清零
|
$this->clear_room_today_hot_value();//0点以后房间热度值清零
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
echo "清除房间离线超24小时的用户:\n";
|
|
||||||
$this->clear_room_offline_user();//0点以后清除房间离线超24小时用户
|
|
||||||
echo "\n";
|
|
||||||
|
|
||||||
echo "系统降身价:\n";
|
echo "系统降身价:\n";
|
||||||
$this->system_downgrade();
|
$this->system_downgrade();
|
||||||
echo "\n";
|
echo "\n";
|
||||||
@@ -37,22 +33,7 @@ class DaySeconds
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 0点以后清除房间离线超24小时用户
|
|
||||||
* 配置:定时脚本每天 0点 执行
|
|
||||||
* 配置:
|
|
||||||
*/
|
|
||||||
public function clear_room_offline_user() {
|
|
||||||
$room = db::name('vs_room_visitor')->where(['is_online' => 2])->select();
|
|
||||||
if($room){
|
|
||||||
foreach ($room as $value) {
|
|
||||||
$time = time() - $value['updatetime'];
|
|
||||||
if($time > 86400){
|
|
||||||
model('api/Room')->quit_room($value['user_id'], $value['room_id'],$value['user_id']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 0点以后房间热度值清零
|
* 0点以后房间热度值清零
|
||||||
|
|||||||
@@ -17,6 +17,27 @@ class RoomHourRanking
|
|||||||
$this->send_gift();//小时榜 送礼物
|
$this->send_gift();//小时榜 送礼物
|
||||||
echo "发礼物结束 \n";
|
echo "发礼物结束 \n";
|
||||||
|
|
||||||
|
echo "清除房间离线超1小时的用户:\n";
|
||||||
|
$this->clear_room_offline_user();
|
||||||
|
echo "\n";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 每小时清除房间离线超1小时用户
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function clear_room_offline_user() {
|
||||||
|
$room = db::name('vs_room_visitor')->where(['is_online' => 2])->select();
|
||||||
|
if($room){
|
||||||
|
foreach ($room as $value) {
|
||||||
|
$time = time() - $value['updatetime'];
|
||||||
|
if($time > 3600){
|
||||||
|
model('api/Room')->quit_room($value['user_id'], $value['room_id'],$value['user_id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function send_gift()
|
public function send_gift()
|
||||||
|
|||||||
Reference in New Issue
Block a user