This commit is contained in:
BoHung Chiu 2020-10-16 16:12:28 +08:00
parent 8938260212
commit 62c78b4e05
2 changed files with 4 additions and 1 deletions

View File

@ -195,8 +195,10 @@ class Admin::VenueManagementBillsController < Admin::VenueAdminController
@bills = @bills.where(:venue_management_main_id.in=>@main_ids).page(params[:page]).per(10) @bills = @bills.where(:venue_management_main_id.in=>@main_ids).page(params[:page]).per(10)
end end
end end
if @bills.nil? if @bills.nil? && params[:id].blank?
@bills = VenueManagementBill.all.page(params[:page]).per(10) @bills = VenueManagementBill.all.page(params[:page]).per(10)
elsif @bills.nil?
@bills = VenueManagementBill.where(:venue_management_main_id=>params[:id])
end end
@bills = @bills.page(1).per(@bills.count) @bills = @bills.page(1).per(@bills.count)
@protocol = (request.referer.blank? ? "http" : URI(request.referer).scheme) @protocol = (request.referer.blank? ? "http" : URI(request.referer).scheme)

View File

@ -53,6 +53,7 @@
</table> </table>
<% filter_url = request.fullpath.split("?")[1..-1].join("?") %> <% filter_url = request.fullpath.split("?")[1..-1].join("?") %>
<% if @venue_management.present? %> <% if @venue_management.present? %>
<% filter_url.blank? ? (filter_url += "id=#{@venue_management.id}") : (filter_url += "&id=#{@venue_management.id}") %>
<!-- footer --> <!-- footer -->
<div class="bottomnav clearfix"> <div class="bottomnav clearfix">
<%= content_tag :div, class: "pagination-centered" do %> <%= content_tag :div, class: "pagination-centered" do %>