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