我的资源附件不能删的问题
This commit is contained in:
parent
55c9faaf7b
commit
aef178183c
|
@ -2618,7 +2618,9 @@ class UsersController < ApplicationController
|
|||
|
||||
# 获取我的资源
|
||||
def get_my_resources author_id, user_course_ids, user_project_ids, order, score
|
||||
author_id = User.find_by_login(author_id).id
|
||||
unless author_id.to_i.to_s == author_id
|
||||
author_id = User.find_by_login(author_id).id
|
||||
end
|
||||
attachments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('OrgSubfield','Principal','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
|
||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
|
||||
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||
|
|
Loading…
Reference in New Issue