ActEffectStatistics.php 816 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\api\controller\analysis;
  4. use app\api\controller\Controller;
  5. use app\api\model\ActEffectStatistics as ActEffectStatisticsModel;
  6. use think\facade\Log;
  7. /**
  8. * 每日执行统计脚本
  9. *
  10. * Class ActEffectStatistics
  11. * @package app\api\controller\analysis
  12. */
  13. class ActEffectStatistics extends Controller
  14. {
  15. /**
  16. * 全部数据
  17. */
  18. public function all()
  19. {
  20. $stime = time();
  21. $this->index();
  22. $etime = time();
  23. Log::info('---- 每日统计脚本执行完成');
  24. echo "执行成功:消耗:".($etime-$stime)."s";
  25. }
  26. public function index()
  27. {
  28. $date = date('Y-m-d', strtotime('-1 days')); // 昨日
  29. // $date = date('Y-m-d');
  30. ActEffectStatisticsModel::addData($date);
  31. }
  32. }