temp fix get current booking
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user