清理房间离线超过1小时的用户
This commit is contained in:
@@ -17,6 +17,27 @@ class RoomHourRanking
|
||||
$this->send_gift();//小时榜 送礼物
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user