app order with order
This commit is contained in:
@@ -35,12 +35,13 @@ class Foodcourt::FoodCourtController < ApplicationController
|
||||
end
|
||||
end
|
||||
end
|
||||
@app_order_new_count =Booking.joins(" JOIN booking_orders ON booking_orders.booking_id=bookings.booking_id")
|
||||
@app_order_new_count = Booking.select("bookings.*,customers.*")
|
||||
.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.current_shop.shop_code}' and bookings.booking_status='assign'").uniq.length
|
||||
puts @app_order_new_count
|
||||
.where("orders.source='app' and bookings.shop_code='#{Shop.current_shop.shop_code}' and DATE(bookings.created_at) = '#{Date.today}' and bookings.booking_status='assign'").uniq.length
|
||||
|
||||
render "foodcourt/addorders/detail"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user