dev_aliyun
jingquan huang 5 years ago
commit 93cd6686a9

@ -23,7 +23,7 @@ class LibrariesController < ApplicationController
per_page = params[:per_page].to_i <= 0 ? 20 : params[:per_page].to_i
@libraries = paginateHelper libraries.includes(:library_tags, :praise_tread_cache, user: :user_extensions), per_page
@download_count_map = Attachment.where(container_type: 'Library', container_id: @libraries.map(&:id)).group(:container_id).count
@download_count_map = Attachment.where(container_type: 'Library', container_id: @libraries.map(&:id)).group(:container_id).sum(:downloads)
end
def show

Loading…
Cancel
Save