attachments=Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)",:p=>search).order("#{order.nil??'created_on':order}#{score}")
attachments=Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)",:p=>search).order("#{order.nil??'created_on':order}#{score}")
end
# 获取我的资源
@ -2816,7 +2816,7 @@ class UsersController < ApplicationController
# 获取我的用户类型资源
defget_principal_resources_publicorder,score
attchments=Attachment.where("container_type = 'Principal'and container_id is not null").order("#{order.nil??'created_on':order}#{score}")
attchments=Attachment.where("container_type = 'Principal'and container_id is not null").order("#{order.nil??'created_on':order}#{score}")