add options in oqs
This commit is contained in:
@@ -2,8 +2,10 @@ class Oqs::HomeController < BaseOqsController
|
|||||||
def index
|
def index
|
||||||
queue_stations=OrderQueueStation.all
|
queue_stations=OrderQueueStation.all
|
||||||
|
|
||||||
|
# Query for OQS with delivery status false
|
||||||
@queue_items_details = queue_items_query(false)
|
@queue_items_details = queue_items_query(false)
|
||||||
|
|
||||||
|
# Query for OQS with delivery status true
|
||||||
@queue_completed_item = queue_items_query(true)
|
@queue_completed_item = queue_items_query(true)
|
||||||
|
|
||||||
@queue_stations_items=Array.new
|
@queue_stations_items=Array.new
|
||||||
@@ -79,29 +81,17 @@ class Oqs::HomeController < BaseOqsController
|
|||||||
render :json => removed_item.to_json
|
render :json => removed_item.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
# Query for OQS with status
|
# Query for OQS with delivery status
|
||||||
def queue_items_query(status)
|
def queue_items_query(status)
|
||||||
puts status
|
AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.station_name, oqs.is_active, df.name as zone, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at")
|
||||||
puts "put what is status"
|
|
||||||
# AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.station_name, oqs.is_active, df.name as zone, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, cus.name as customer_name, odt.created_at")
|
|
||||||
# .joins(" left join order_queue_process_by_zones as oqpz ON oqpz.order_queue_station_id = assigned_order_items.order_queue_station_id
|
|
||||||
# left join dining_facilities as df on df.zone_id = oqpz.zone_id
|
|
||||||
# left join order_queue_stations as oqs ON oqs.id = assigned_order_items.order_queue_station_id
|
|
||||||
# left join orders as od ON od.order_id = assigned_order_items.order_id
|
|
||||||
# left join order_items as odt ON odt.item_code = assigned_order_items.item_code
|
|
||||||
# left join customers as cus ON cus.customer_id = od.customer_id")
|
|
||||||
# .where("assigned_order_items.delivery_status = #{status}")
|
|
||||||
# .group("assigned_order_items.assigned_order_item_id")
|
|
||||||
# .order("odt.item_name DESC")
|
|
||||||
AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.station_name, oqs.is_active, df.name as zone, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, cus.name as customer_name, odt.created_at")
|
|
||||||
.joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id
|
.joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id
|
||||||
left join orders as od ON od.order_id = assigned_order_items.order_id
|
left join orders as od ON od.order_id = assigned_order_items.order_id
|
||||||
left join order_items as odt ON odt.item_code = assigned_order_items.item_code
|
left join order_items as odt ON odt.item_code = assigned_order_items.item_code AND odt.order_id = assigned_order_items.order_id
|
||||||
left join customers as cus ON cus.customer_id = od.customer_id
|
left join customers as cus ON cus.customer_id = od.customer_id
|
||||||
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
|
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
|
||||||
left join bookings as bk on bk.booking_id = bo.booking_id
|
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")
|
left join dining_facilities as df on df.id = bk.dining_facility_id")
|
||||||
.where("assigned_order_items.delivery_status = #{status}")
|
.where("assigned_order_items.delivery_status = #{status}")
|
||||||
.group("assigned_order_items.assigned_order_item_id,oqs.station_name,oqs.is_active,df.name,odt.item_code,odt.item_name,odt.price, odt.qty, odt.item_order_by,cus.name,odt.created_at")
|
.group("odt.order_items_id")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -49,10 +49,9 @@
|
|||||||
<%= qid.qty %>
|
<%= qid.qty %>
|
||||||
</span> ]
|
</span> ]
|
||||||
</h4>
|
</h4>
|
||||||
<!--
|
|
||||||
Item Options
|
<p class="card-text"><%= qid.options %></p>
|
||||||
<p class="card-text">Medium, Fries, Salad</p>
|
|
||||||
-->
|
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
<small class="text-muted">Order at
|
<small class="text-muted">Order at
|
||||||
<span class="order-at">
|
<span class="order-at">
|
||||||
@@ -100,10 +99,9 @@
|
|||||||
<%= qid.qty %>
|
<%= qid.qty %>
|
||||||
</span> ]
|
</span> ]
|
||||||
</h4>
|
</h4>
|
||||||
<!--
|
|
||||||
Item Options
|
<p class="card-text"><%= qid.options %></p>
|
||||||
<p class="card-text">Medium, Fries, Salad</p>
|
|
||||||
-->
|
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
<small class="text-muted">Order at
|
<small class="text-muted">Order at
|
||||||
<span class="order-at">
|
<span class="order-at">
|
||||||
|
|||||||
Reference in New Issue
Block a user