| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace app\api\command;
- use think\console\Command;
- use think\console\Input;
- use think\console\Output;
- use app\common\logic\AirdropLogic;
- use app\common\model\UserAirdrop;
- use think\Model;
- //空投,发放
- class SenAirdrop extends Command
- {
- protected function configure()
- {
- $this->setName('SenAirdrop')->setDescription('Here is the remark ');
- }
- protected function execute(Input $input, Output $output)
- {
- // 记录开始运行的时间
- $GLOBALS['_beginTime'] = microtime(TRUE);
- $output->writeln('定时任务开始执行:' . date('Y-m-d H:i:s', time()));
- // 发放团队奖励
- $teamRewards = new AirdropLogic();
- $teamRewards->setAirdropRewards();
-
- $time_total = round(microtime(true) - $GLOBALS['_beginTime'], 4);//计算耗时
- $output->writeln('定时任务执行结束,总耗时' . date('Y-m-d H:i:s', time()) . '; 耗时:' . $time_total . '秒');
- }
- }
|