diff --git a/app/jobs/daily_platform_statistics_job.rb b/app/jobs/daily_platform_statistics_job.rb index 5610f304..a65fa3c6 100644 --- a/app/jobs/daily_platform_statistics_job.rb +++ b/app/jobs/daily_platform_statistics_job.rb @@ -12,7 +12,7 @@ class DailyPlatformStatisticsJob < ApplicationJob ActiveJob::Base.logger.info "job baidu_tongji_auth access_token ===== #{access_token}" # 从最后一个记录日期开始,如果遗漏日期数据可以补充数据 last_date = DailyPlatformStatistic.order(:date).last - start_date = last_date.date + start_date = last_date.present? ? last_date.date : 1.days.ago.beginning_of_day end_date = Time.now if access_token.present? tongji_service.overview_batch_add(start_date, end_date)