ecloud_sso
daiao 5 years ago
parent 52017c9858
commit 75870ba4d9

@ -387,7 +387,7 @@ class Course < ApplicationRecord
end end
def max_activity_time def max_activity_time
course_acts.pluck(:updated_at).max course_activities.pluck(:updated_at).max
end end
# 课堂作业数 # 课堂作业数

@ -45,7 +45,7 @@ class Admins::SchoolDailyStatisticService < ApplicationService
courses = Course.where(is_delete: 0, school_id: ids).group('school_id') courses = Course.where(is_delete: 0, school_id: ids).group('school_id')
course_map = courses.count course_map = courses.count
Rails.logger.info("####courses_daiao: #{courses.inspect}") 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 active_course_map = courses.where(is_end: false).count
shixun_map = Shixun.joins(user: :user_extension).where(user_extensions: { identity: :teacher, school_id: ids }) shixun_map = Shixun.joins(user: :user_extension).where(user_extensions: { identity: :teacher, school_id: ids })

Loading…
Cancel
Save