|
|
@ -41,11 +41,14 @@ class StatisticSchoolDailyReportTask
|
|
|
|
shixun_increase_count: shixun_count, active_user_count: active_user_count, date: current_date
|
|
|
|
shixun_increase_count: shixun_count, active_user_count: active_user_count, date: current_date
|
|
|
|
}
|
|
|
|
}
|
|
|
|
report = SchoolDailyReport.create!(create_params)
|
|
|
|
report = SchoolDailyReport.create!(create_params)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if active_user_ids.present?
|
|
|
|
values = '(' + active_user_ids.join(", #{report.id}),(") + ", #{report.id})"
|
|
|
|
values = '(' + active_user_ids.join(", #{report.id}),(") + ", #{report.id})"
|
|
|
|
user_sql = "INSERT INTO school_daily_active_users(user_id, school_daily_report_id) VALUES#{values}"
|
|
|
|
user_sql = "INSERT INTO school_daily_active_users(user_id, school_daily_report_id) VALUES#{values}"
|
|
|
|
SchoolDailyActiveUser.connection.execute(user_sql)
|
|
|
|
SchoolDailyActiveUser.connection.execute(user_sql)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
private
|
|
|
|
def current_date
|
|
|
|
def current_date
|
|
|
|