@ -2273,9 +2273,19 @@ class UsersController < ApplicationController
attchments=Attachment.where("(author_id = #{author_id} and container_type = 'Course' and is_publish = 1) or (container_type = 'Course' and container_id in (#{user_course_ids.empty??'0':user_course_ids.join(',')}) and is_publish = 1) ").order("created_on desc")
attchments=Attachment.where("(author_id = #{author_id} and container_type = 'Course' and is_publish = 1) or (container_type = 'Course' and container_id in (#{user_course_ids.empty??'0':user_course_ids.join(',')}) and is_publish = 1) ").order("created_on desc")
end
end
# 获取公共资源课程
defget_course_resources_publicuser_course_ids
attchments=Attachment.where("(container_type = 'Course' and is_publish = 1) or (container_type = 'Course' and container_id in (#{user_course_ids.empty??'0':user_course_ids.join(',')}) and is_publish = 1) ").order("created_on desc")
attchments=Attachment.where("author_id = #{author_id} and container_type = 'Project'").order("created_on desc")
attchments=Attachment.where("(author_id = #{author_id} and container_type = 'Project') or (container_type = 'Course' and container_id in (#{user_project_ids.empty??'0':user_project_ids.join(',')}) and is_publish = 1) ").order("created_on desc")
end
# 获取公共资源的项目资源
defget_project_resources_publicuser_project_ids
attchments=Attachment.where("(container_type = 'Project') or (container_type = 'Project' and container_id in (#{user_project_ids.empty??'0':user_project_ids.join(',')}) and is_publish = 1) ").order("created_on desc")
end
end
# 获取我上传的附件
# 获取我上传的附件
@ -2283,11 +2293,21 @@ class UsersController < ApplicationController
attchments=Attachment.where("author_id = #{author_id} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')").order("created_on desc")
attchments=Attachment.where("author_id = #{author_id} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')").order("created_on desc")