From 909d40b4eb462e4aa28a5242792580bec8dcbebd Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 24 May 2016 17:14:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=98=BE=E7=A4=BA=E5=85=AC?= =?UTF-8?q?=E5=85=B1=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6f3cca744..cff97e423 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2050,7 +2050,7 @@ class UsersController < ApplicationController @score = @b_sort == "desc" ? "asc" : "desc" user_project_ids = User.current.projects.map {|p| p.id} user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 - if(params[:type].blank? || params[:type] == "1") # 我的资源 + if(params[:type] == "1") # 我的资源 # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 if params[:status] == "2" @attachments = get_course_resources(params[:id], user_course_ids, @order, @score) @@ -2064,7 +2064,7 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score) end - elsif params[:type] == "6" # 公共资源 + elsif (params[:type].blank? || params[:type] == "6") # 公共资源 if params[:status] == "2" @attachments = get_course_resources_public( user_course_ids, @order, @score) elsif params[:status] == "3" @@ -2203,7 +2203,7 @@ class UsersController < ApplicationController @score = @b_sort == "desc" ? "asc" : "desc" user_project_ids = User.current.projects.map {|p| p.id} user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 - if(params[:type].blank? || params[:type] == "1") # 我的资源 + if(params[:type] == "1") # 我的资源 # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 if params[:status] == "2" @attachments = get_course_resources(params[:id], user_course_ids, @order, @score) @@ -2217,7 +2217,7 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score) end - elsif params[:type] == "6" # 公共资源 + elsif (params[:type].blank? || params[:type] == "6") # 公共资源 if params[:status] == "2" @attachments = get_course_resources_public( user_course_ids, @order, @score) elsif params[:status] == "3" @@ -2344,7 +2344,7 @@ class UsersController < ApplicationController @score = @b_sort == "desc" ? "asc" : "desc" user_project_ids = User.current.projects.map {|p| p.id} user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 - if(params[:type].blank? || params[:type] == "1") # 我的资源 + if(params[:type] == "1") # 我的资源 # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 if params[:status] == "2" @attachments = get_course_resources(params[:id], user_course_ids, @order, @score) @@ -2358,7 +2358,7 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score) end - elsif params[:type] == "6" # 公共资源 + elsif (params[:type].blank? || params[:type] == "6") # 公共资源 if params[:status] == "2" @attachments = get_course_resources_public( user_course_ids, @order, @score) elsif params[:status] == "3"