From f806dbf587dd20d910b251ed658a7e5d26803b9b Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 19 May 2016 17:12:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=8F=91=E9=80=81=E8=87=B3?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=92=8C=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5148f3318..d86ce379b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2058,6 +2058,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) 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 @type = params[:type] @limit = 25 @@ -2340,6 +2352,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) 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 @type = params[:type] @limit = 25