1029 修复部分课程资源排序不可用问题

competition
chenmin 11 years ago
parent 226d19b912
commit 8b217735c3

@ -40,7 +40,19 @@ class FilesController < ApplicationController
render :layout => !request.xhr?
elsif params[:course_id]
@isproject = false
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
@order = params[:sort].split(",")[0];
@orderBy = @order.split(":")[0];
@orderType = @order.split(":")[1];
if @orderBy=="size"
@orderBy="filesize"
elsif @orderBy=="field_file_dense"
@orderBy="is_public"
elsif @orderBy=="attach_type"
@orderBy="attachtype"
elsif @orderBy=="content_type"
@orderBy="attachtype"
end
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)]
render :layout => 'base_courses'
end
end

Loading…
Cancel
Save