36 lines
783 B
PHP
36 lines
783 B
PHP
<?php
|
|
|
|
|
|
namespace app\common\command;
|
|
|
|
|
|
use think\console\Command;
|
|
use think\console\Input;
|
|
use think\console\Output;
|
|
|
|
class ClearUserDecorate extends Command
|
|
{
|
|
protected function configure()
|
|
{
|
|
$this->setName('clear-user-decorate')
|
|
->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(5);
|
|
$reslut = model('admin/Decorate')->clear_user_decorate();
|
|
echo '清理成功!';
|
|
}
|
|
}
|
|
} |