|
|
@ -1,5 +1,6 @@
|
|
|
|
class StatisticSchoolDailyReportTask
|
|
|
|
class StatisticSchoolDailyReportTask
|
|
|
|
def call
|
|
|
|
def call
|
|
|
|
|
|
|
|
begin_evaluate = EvaluateRecord.where("created_at <'#{yesterday.first}'").reorder("id desc").limit(1)
|
|
|
|
School.find_each do |school|
|
|
|
|
School.find_each do |school|
|
|
|
|
# 新增教师和学生
|
|
|
|
# 新增教师和学生
|
|
|
|
users = User.joins(:user_extensions)
|
|
|
|
users = User.joins(:user_extensions)
|
|
|
@ -30,6 +31,7 @@ class StatisticSchoolDailyReportTask
|
|
|
|
.joins('LEFT JOIN homework_commons hc ON hcs.homework_common_id = hc.id AND hc.homework_type = 4')
|
|
|
|
.joins('LEFT JOIN homework_commons hc ON hcs.homework_common_id = hc.id AND hc.homework_type = 4')
|
|
|
|
.joins('LEFT JOIN course_members ON course_members.user_id = evaluate_records.user_id')
|
|
|
|
.joins('LEFT JOIN course_members ON course_members.user_id = evaluate_records.user_id')
|
|
|
|
.joins('LEFT JOIN courses ON course_members.course_id = courses.id AND hc.course_id = courses.id')
|
|
|
|
.joins('LEFT JOIN courses ON course_members.course_id = courses.id AND hc.course_id = courses.id')
|
|
|
|
|
|
|
|
.where("evaluate_records.id > ?", begin_evaluate.first.id)
|
|
|
|
.where(courses: { school_id: school.id })
|
|
|
|
.where(courses: { school_id: school.id })
|
|
|
|
.where(created_at: yesterday).reorder(nil).count
|
|
|
|
.where(created_at: yesterday).reorder(nil).count
|
|
|
|
# shixun_evaluate_count = 0
|
|
|
|
# shixun_evaluate_count = 0
|
|
|
|