app order

This commit is contained in:
Myat Zin Wai Maw
2019-12-03 17:49:01 +06:30
parent 600d3973cd
commit fe56286c76
13 changed files with 215 additions and 736 deletions

View File

@@ -34,7 +34,12 @@ class Foodcourt::FoodCourtController < ApplicationController
end
end
end
@app_order_new_count =Booking.joins(" JOIN booking_orders ON booking_orders.booking_id=bookings.booking_id")
.joins("JOIN orders ON orders.order_id=booking_orders.order_id")
.joins("JOIN order_items ON orders.order_id=order_items.order_id")
.joins("JOIN customers ON orders.customer_id=customers.customer_id")
.where("orders.source='app' and bookings.shop_code='#{@shop.shop_code}' and bookings.booking_status='assign'").uniq.length
puts @app_order_new_count
render "foodcourt/addorders/detail"
end