Updated the conditions checked while updating the booking status of a room
This commit is contained in:
@@ -1419,7 +1419,8 @@ class HotelBookingDetail extends ObjectModel
|
||||
// This function algo is same as available rooms algo and it not similar to booked rooms algo.
|
||||
public function chechRoomBooked($id_room, $date_from, $date_to)
|
||||
{
|
||||
$sql = 'SELECT `id`, `id_product`, `id_order`, `id_cart`, `id_room`, `id_hotel`, `id_customer`
|
||||
$sql = 'SELECT `id`, `id_product`, `id_order`, `id_cart`, `id_room`, `id_hotel`, `id_customer`,
|
||||
`check_out`, `check_in`, `id_status`
|
||||
FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `id_room` = '.(int)$id_room.
|
||||
' AND `is_back_order` = 0 AND `is_refunded` = 0 AND ((date_from <= \''.pSQL($date_from).'\' AND date_to > \''.
|
||||
pSQL($date_from).'\' AND date_to <= \''.pSQL($date_to).'\') OR (date_from > \''.pSQL($date_from).
|
||||
@@ -1431,6 +1432,8 @@ class HotelBookingDetail extends ObjectModel
|
||||
$sql .= ' AND `id` !='.(int) $this->id;
|
||||
}
|
||||
|
||||
$sql .= ' ORDER BY `date_add` DESC';
|
||||
|
||||
return Db::getInstance()->getRow($sql);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user