按时间查询

This commit is contained in:
alan 2014-04-03 16:46:22 +08:00
parent e5470db875
commit 272be122e5
1 changed files with 2 additions and 2 deletions

View File

@ -33,8 +33,8 @@ class FilesController < ApplicationController
'size' => "#{Attachment.table_name}.filesize",
'downloads' => "#{Attachment.table_name}.downloads"
@containers = [ Project.includes(:attachments).reorder("attachments.created_on DESC").find(@project.id)] #modify by Long Jun
@containers += @project.versions.includes(:attachments).reorder("created_on DESC").all.sort
@containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)] #modify by Long Jun
@containers += @project.versions.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").all.sort
if @project.project_type == 1
render :layout => 'base_courses'