temp fix get current booking

This commit is contained in:
Yan
2017-11-16 21:14:59 +06:30
parent 25fef8e61c
commit a175ce3aeb

View File

@@ -32,7 +32,7 @@ class DiningFacility < ApplicationRecord
end
def get_current_booking
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}'").limit(1) #and checkout_at is null
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and checkout_by is null").limit(1) #and checkout_at is null
if booking.count > 0 then
return booking[0]
else