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 })