diff --git a/app/controllers/admin/venue_management_bills_controller.rb b/app/controllers/admin/venue_management_bills_controller.rb index aaa1f5b..be5efab 100644 --- a/app/controllers/admin/venue_management_bills_controller.rb +++ b/app/controllers/admin/venue_management_bills_controller.rb @@ -195,8 +195,10 @@ class Admin::VenueManagementBillsController < Admin::VenueAdminController @bills = @bills.where(:venue_management_main_id.in=>@main_ids).page(params[:page]).per(10) end end - if @bills.nil? + if @bills.nil? && params[:id].blank? @bills = VenueManagementBill.all.page(params[:page]).per(10) + elsif @bills.nil? + @bills = VenueManagementBill.where(:venue_management_main_id=>params[:id]) end @bills = @bills.page(1).per(@bills.count) @protocol = (request.referer.blank? ? "http" : URI(request.referer).scheme) diff --git a/app/views/admin/venue_management_bills/_index.html.erb b/app/views/admin/venue_management_bills/_index.html.erb index 2c82eca..87b8917 100644 --- a/app/views/admin/venue_management_bills/_index.html.erb +++ b/app/views/admin/venue_management_bills/_index.html.erb @@ -53,6 +53,7 @@ <% filter_url = request.fullpath.split("?")[1..-1].join("?") %> <% if @venue_management.present? %> + <% filter_url.blank? ? (filter_url += "id=#{@venue_management.id}") : (filter_url += "&id=#{@venue_management.id}") %>
<%= content_tag :div, class: "pagination-centered" do %>