初始化代码
This commit is contained in:
35
application/common/command/NobilityOverTime.php
Normal file
35
application/common/command/NobilityOverTime.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\common\command;
|
||||
|
||||
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\Output;
|
||||
|
||||
class NobilityOverTime extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('nobility-over-time')
|
||||
->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(1);
|
||||
$reslut = model('api/Nobility')->user_nobility_over_time();
|
||||
echo '爵位到期!';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user