From 75870ba4d972498202c33d1ea3f47ed037dfdac9 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 28 Feb 2020 11:27:03 +0800 Subject: [PATCH] 1 --- app/models/course.rb | 2 +- app/services/admins/school_daily_statistic_service.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index f7db61995..14c17cf39 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -387,7 +387,7 @@ class Course < ApplicationRecord end def max_activity_time - course_acts.pluck(:updated_at).max + course_activities.pluck(:updated_at).max end # 课堂作业数 diff --git a/app/services/admins/school_daily_statistic_service.rb b/app/services/admins/school_daily_statistic_service.rb index f81bc7bb6..fec289eae 100644 --- a/app/services/admins/school_daily_statistic_service.rb +++ b/app/services/admins/school_daily_statistic_service.rb @@ -45,7 +45,7 @@ class Admins::SchoolDailyStatisticService < ApplicationService courses = Course.where(is_delete: 0, school_id: ids).group('school_id') course_map = courses.count Rails.logger.info("####courses_daiao: #{courses.inspect}") - nearly_course_time_map = courses.joins(:course_acts).maximum('course_activities.updated_at') + nearly_course_time_map = courses.joins(:course_activities).maximum('course_activities.updated_at') active_course_map = courses.where(is_end: false).count shixun_map = Shixun.joins(user: :user_extension).where(user_extensions: { identity: :teacher, school_id: ids })