This commit is contained in:
yarzar_code
2020-01-12 20:07:28 +06:30
parent 314cc507a3
commit dff2c69627
89 changed files with 492 additions and 469 deletions

View File

@@ -6,8 +6,8 @@ class Oqs::HomeController < BaseOqsController
# Query for OQS with delivery status true
# @tables = DiningFacility.all.active.order('status desc')
@tables = DiningFacility.all.active.where("type = 'Table' and shop_code='#{@shop.shop_code}' ").order('status desc')
@rooms = DiningFacility.all.active.where("type = 'Room' and shop_code='#{@shop.shop_code}' ").order('status desc')
@tables = DiningFacility.all.active.where("type = 'Table'").order('status desc')
@rooms = DiningFacility.all.active.where("type = 'Room'").order('status desc')
@filter = params[:filter]
@@ -232,7 +232,7 @@ class Oqs::HomeController < BaseOqsController
left join bookings as bk on bk.booking_id = bo.booking_id
left join dining_facilities as df on df.id = bk.dining_facility_id")
.where("assigned_order_items.created_at between '#{Time.now.beginning_of_day.utc}' and '#{Time.now.end_of_day.utc}'")
query = query.where("df.shop_code='#{@shop.shop_code}' and df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
query = query.where("df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
.group("odt.order_items_id")
.order("assigned_order_items.created_at desc")