app order

This commit is contained in:
Myat Zin Wai Maw
2019-12-02 17:48:36 +06:30
parent cac6994ccb
commit 600d3973cd
4 changed files with 14 additions and 12 deletions

View File

@@ -91,6 +91,9 @@ class Foodcourt::OrdersController < BaseFoodcourtController
.where("orders.source='app' and bookings.shop_code='#{@shop.shop_code}'").order("created_at desc")
end
def app_order_by_booking
@order_items = OrderItems.joins("JOIN orders ON orders.order_id=order_items.order_id")
.joins("JOIN booking_orders ON booking_orders.order_id=orders.order_id")
.where("orders.source='app' and booking_orders.booking_id='#{params[:booking_id]}'").order("created_at desc")
end
end