Files
mier-php/application/common/command/ClearRoomRobot.php

37 lines
759 B
PHP
Raw Permalink Normal View History

2025-08-11 10:22:05 +08:00
<?php
namespace app\common\command;
use think\console\Command;
use think\console\Input;
use think\console\Output;
class ClearRoomRobot extends Command
{
protected function configure()
{
$this->setName('clear-room-robot')
->setDescription('清理空房间机器人');
}
/**
* 清理空房间机器人
* @param Input $input
* @param Output $output
* @return int|void|null
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
protected function execute(Input $input, Output $output)
{
while (true) {
sleep(60);
model('api/room')->auto_clear_robot_room();
echo '清理空房间机器人!'.PHP_EOL;
}
}
}