This commit is contained in:
BoHung Chiu 2020-10-30 08:19:46 +08:00
parent 8f6bee5a8b
commit 690b219da0
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ class GalleriesController < ApplicationController
if albums_with_order.count == page_data_count if albums_with_order.count == page_data_count
albums_no_order = [] albums_no_order = []
else else
albums_no_order = album_tp.desc(:created_at).where(:order.in=>[-1,nil])[0...(page_data_count - albums_with_order.count)] albums_no_order = album_tp.desc(:created_at).where(:order.in=>[-1,nil]).page(nil).per(all_count)[0...(page_data_count - albums_with_order.count)]
end end
else else
start_index = (page_data_count - (with_order_count % page_data_count) + page_data_count*(page_no - 1 - with_order_total_pages)) start_index = (page_data_count - (with_order_count % page_data_count) + page_data_count*(page_no - 1 - with_order_total_pages))