Test.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\api\command;
  3. use app\common\logic\ScanLogic;
  4. use think\console\Command;
  5. use think\console\Input;
  6. use think\console\Output;
  7. use app\common\logic\TeamRewards;
  8. use app\common\model\TimedTaskLogModel;
  9. use think\Model;
  10. class Test extends Command
  11. {
  12. protected function configure()
  13. {
  14. $this->setName('test')->setDescription('Here is the remark ');
  15. }
  16. protected function execute(Input $input, Output $output)
  17. {
  18. /* 永不超时 */
  19. // ini_set('max_execution_time', 0);
  20. // 记录开始运行的时间
  21. $GLOBALS['_beginTime'] = microtime(TRUE);
  22. $output->writeln('定时任务开始执行:' . date('Y-m-d H:i:s', time()));
  23. /*** 发放分红收益 ***/
  24. $begin_usdt = microtime(TRUE);
  25. $output->writeln("开始发放加权分红:");
  26. (new \app\api\controller\Test())->reset_team();
  27. $time_total = round(microtime(true) - $GLOBALS['_beginTime'], 4);//计算耗时
  28. $output->writeln('定时任务执行结束,总耗时' . date('Y-m-d H:i:s', time()) . '; 耗时:' . $time_total . '秒');
  29. }
  30. }