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 '清理成功!'; } } }