I am trying to build hotel room booking management system using Laravel.
Problem in retrieving room available based on the user search in the portal
Hotel has many rooms and rooms has different tariff based on the date. I need all the rooms based on the check in and check out date. But i am getting all the records which are there in database between that days. I want only the hotels room which are available on those days.
Example: User is searching hotel from 19-11-2019 to 22-11-2019. But some hotel inventory are not there on 21-11-2019. But i am getting that records.
HotelPriceDetail::where('room_id',$value->room_id)
->whereBetween('hotel_price_details.date',[$check_in,$check_out])
->where('hotel_price_details.inventory','>=',$total_adults)
->get();
Can any one suggest me what i need to change in my code.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire