mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
107279984-refactor
This commit is contained in:
parent
96552a0344
commit
c4ead607da
1 changed files with 0 additions and 31 deletions
|
@ -22,46 +22,15 @@ class Admin::AccountActivitiesController < AdminController
|
||||||
@b = AccountActivity.search(balance_params)
|
@b = AccountActivity.search(balance_params)
|
||||||
@q.sorts = 'id desc' if @q.sorts.empty?
|
@q.sorts = 'id desc' if @q.sorts.empty?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@account_activities = @q.result.page(params[:page]).per(params[:results_per_page])
|
@account_activities = @q.result.page(params[:page]).per(params[:results_per_page])
|
||||||
sort = @account_activities.orders.map(&:to_sql).join(",")
|
sort = @account_activities.orders.map(&:to_sql).join(",")
|
||||||
|
|
||||||
|
|
||||||
if params[:page] && params[:page].to_i > 1
|
if params[:page] && params[:page].to_i > 1
|
||||||
|
|
||||||
|
|
||||||
@sum = @q.result.reorder(sort).limit(@account_activities.offset_value) + @b.result.where.not(id: @q.result.map(&:id))
|
@sum = @q.result.reorder(sort).limit(@account_activities.offset_value) + @b.result.where.not(id: @q.result.map(&:id))
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
@sum = @b.result.where.not(id: @q.result.map(&:id))
|
@sum = @b.result.where.not(id: @q.result.map(&:id))
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# throw "cdsfs"
|
|
||||||
|
|
||||||
# if params[:page] && params[:page].to_i > 1
|
|
||||||
#
|
|
||||||
# @b = @q.result.page(params[:page].to_i - 1)
|
|
||||||
#
|
|
||||||
# @b = @b.per(params[:results_per_page])
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# else
|
|
||||||
#
|
|
||||||
# @b = AccountActivity.search(balance_params)
|
|
||||||
#
|
|
||||||
# @b = @b.result.where.not(id: @q.result.map(&:id))
|
|
||||||
#
|
|
||||||
# end
|
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.csv do
|
format.csv do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue