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 %>提交
<%=(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 %>提交