|
|
|
@ -18,7 +18,7 @@ class FilesController < ApplicationController
|
|
|
|
|
sort_type = params[:sort_type] || 'created_on' # created_on:时间排序, downloads:下载次数排序; quotes: 引用次数排序
|
|
|
|
|
@course_second_category_id = params[:course_second_category_id] || 0 # 0: 为主目录, 其他为次目录id
|
|
|
|
|
@user = current_user
|
|
|
|
|
@attachments = @course_second_category_id.to_i == 0 ? @course.attachments.includes(:course_second_category) : @course.attachments.by_course_second_category_id(course_second_category_id)
|
|
|
|
|
@attachments = @course_second_category_id.to_i == 0 ? @course.attachments.includes(:course_second_category) : @course.attachments.by_course_second_category_id(@course_second_category_id)
|
|
|
|
|
@attachments = @attachments.includes(author: [:user_extension, :course_members])
|
|
|
|
|
.ordered(sort: sort.to_i, sort_type: sort_type.strip)
|
|
|
|
|
|
|
|
|
|