diff --git a/app/models/school.rb b/app/models/school.rb index 62e27987..8d377e97 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -66,4 +66,10 @@ class School < ActiveRecord::Base dep = departments.where("identifier is not null").first url = dep.present? ? "/colleges/#{dep.identifier}/statistics" : "" end + + def course_act_time + CourseActivity.find_by_sql("SELECT max(ca.updated_at) as max_update FROM course_activities ca left join courses on ca.course_id = + courses.id LEFT JOIN user_extensions ON courses.tea_id=user_extensions.user_id WHERE + user_extensions.`school_id` = #{self.id}").first.try(:max_update) + end end diff --git a/app/views/cooperates/_partner_item.html.erb b/app/views/cooperates/_partner_item.html.erb index 09490e39..87b94c8e 100644 --- a/app/views/cooperates/_partner_item.html.erb +++ b/app/views/cooperates/_partner_item.html.erb @@ -19,7 +19,7 @@ <%= school.course_count %> <%= school.shixun_count %> <%= school.shixun_report_count %> - 2019-04-11 时间 + <%= school.course_act_time.present? ? format_time(school.course_act_time) : "--" %> <% if school.statistic_url != "" %> 查看