资源发送至组织和课程
This commit is contained in:
parent
e0370e3e32
commit
f806dbf587
|
@ -2058,6 +2058,18 @@ class UsersController < ApplicationController
|
||||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||||
end
|
end
|
||||||
|
elsif params[:type] == "2"
|
||||||
|
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
|
||||||
|
if params[:status] == "2"
|
||||||
|
resource_type = "'Course'"
|
||||||
|
elsif params[:status] == "3"
|
||||||
|
resource_type = "'Project'"
|
||||||
|
elsif params[:status] == "5"
|
||||||
|
resource_type = "'Principal'"
|
||||||
|
else
|
||||||
|
resource_type = "'Project','OrgSubfield','Principal','Course'"
|
||||||
|
end
|
||||||
|
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
|
||||||
end
|
end
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
@limit = 25
|
@limit = 25
|
||||||
|
@ -2340,6 +2352,18 @@ class UsersController < ApplicationController
|
||||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||||
end
|
end
|
||||||
|
elsif params[:type] == "2"
|
||||||
|
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
|
||||||
|
if params[:status] == "2"
|
||||||
|
resource_type = "'Course'"
|
||||||
|
elsif params[:status] == "3"
|
||||||
|
resource_type = "'Project'"
|
||||||
|
elsif params[:status] == "5"
|
||||||
|
resource_type = "'Principal'"
|
||||||
|
else
|
||||||
|
resource_type = "'Project','OrgSubfield','Principal','Course'"
|
||||||
|
end
|
||||||
|
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
|
||||||
end
|
end
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
@limit = 25
|
@limit = 25
|
||||||
|
|
Loading…
Reference in New Issue