diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index efce039aa..a71208248 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2992,6 +2992,7 @@ int main(int argc, char** argv){ unless projects.empty? project_ids = '('+projects.map{|pro|pro.project_id}.join(',')+')' sort_projects = ForgeActivity.find_by_sql("SELECT MAX(updated_at) AS updated_at,user_id, project_id FROM forge_activities WHERE project_id IN #{project_ids} GROUP BY project_id ORDER BY MAX(updated_at) DESC") + return sort_projects end end diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 783193e46..7b51ef568 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -223,15 +223,13 @@ <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %> <% end %> <% com_time = project.project_score.commit_time %> - <% time=project.updated_on %> <% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> - <% time= time > forge_time ? time : forge_time %>

<%=(User.find project.user_id).show_name %>(组长)

-

<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %>  <%= project.project_score.changeset_num %>提交

+

<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>  <%= project.project_score.changeset_num %>提交

项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
- 更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %> + 更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>
<% if i == 9 && projects.count > 10 %> diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 4c8e17d5d..1b9490918 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -233,15 +233,13 @@ <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像") %> <% end %> <% com_time = project.project_score.commit_time %> - <% time=project.updated_on %> <% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> - <% time= time > forge_time ? time : forge_time %>

<%=(User.find project.user_id).show_name %>(组长)

-

<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %>  <%= project.project_score.changeset_num %>提交

+

<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>  <%= project.project_score.changeset_num %>提交

项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
- 更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %> + 更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>
<% if i == 9 && projects.count > 10 %>