“合作伙伴”的管理员用户在“客户管理”页面中增加最新课堂动态时间

dev_haigong
cxt 6 years ago
parent 44f7cebbed
commit d62ffc27ff

@ -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

@ -19,7 +19,7 @@
<span class="column-2"><%= school.course_count %></span>
<span class="column-2"><%= school.shixun_count %></span>
<span class="column-2"><%= school.shixun_report_count %></span>
<span class="column-2">2019-04-11 时间</span>
<span class="column-2"><%= school.course_act_time.present? ? format_time(school.course_act_time) : "--" %></span>
<span class="column-2 fr">
<% if school.statistic_url != "" %>
<a href="<%= school.statistic_url %>" target="_blank" class="color-blue">查看</a>

Loading…
Cancel
Save