|
|
|
@ -41,9 +41,12 @@ class StatisticSchoolDailyReportTask
|
|
|
|
|
shixun_increase_count: shixun_count, active_user_count: active_user_count, date: current_date
|
|
|
|
|
}
|
|
|
|
|
report = SchoolDailyReport.create!(create_params)
|
|
|
|
|
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}"
|
|
|
|
|
SchoolDailyActiveUser.connection.execute(user_sql)
|
|
|
|
|
|
|
|
|
|
if active_user_ids.present?
|
|
|
|
|
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}"
|
|
|
|
|
SchoolDailyActiveUser.connection.execute(user_sql)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|