Fix cannot display new gallery caused by the limit at filter_by_widget_categories.

This commit is contained in:
chiu 2020-06-05 23:50:09 +08:00
parent 8edd91781e
commit 9654db689a
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ class GalleriesController < ApplicationController
end
def widget
tags = OrbitHelper.widget_tags.empty? ? ["all"] : OrbitHelper.widget_tags
album_ids = Album.filter_by_widget_categories.filter_by_tags(tags).pluck(:id)
album_ids = Album.filter_by_widget_categories(OrbitHelper.widget_categories,false).filter_by_tags(tags).pluck(:id)
params = OrbitHelper.params
counts = OrbitHelper.widget_data_count
images = AlbumImage.where({album_id:{"$in"=>album_ids}}).desc(:id).limit(counts *5).sample(counts)