初始化代码
This commit is contained in:
36
application/common/command/ClearUserDecorate.php
Normal file
36
application/common/command/ClearUserDecorate.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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 '清理成功!';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user