#994 作品下载:资源排序修正
This commit is contained in:
parent
31351bc9e8
commit
fd676f13b5
|
@ -143,12 +143,17 @@ class FilesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
@containers = [ Project.includes(:attachments).reorder(sort).find(@project.id)]
|
||||
@containers += @project.versions.includes(:attachments).reorder(sort).all
|
||||
@containers = [ Project.includes(:attachments).find(@project.id)]
|
||||
@containers += @project.versions.includes(:attachments).all
|
||||
|
||||
ids = []
|
||||
@containers.each do |c|
|
||||
ids += c.attachments.pluck(:id)
|
||||
end
|
||||
@containers = [Struct.new(:attachments).new(Attachment.where('id in (?)',ids).reorder(sort))]
|
||||
|
||||
show_attachments @containers
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
|
|
Loading…
Reference in New Issue