Fixed issues

Co-authored-by: Name <sumit201@webkul.in>
This commit is contained in:
varun kewlani
2026-08-20 20:45:52 +05:30
parent e809801366
commit 11c4fa8248
12 changed files with 205 additions and 321 deletions

View File

@@ -1370,15 +1370,16 @@ class AdminStatsControllerCore extends AdminStatsTabController
);
}
public static function getTotalRooms($idHotel = null, $active = null)
public static function getTotalRooms($idHotel = null, $active = null, $idProduct = null)
{
$sql = 'SELECT COUNT(hri.`id`)
FROM `'._DB_PREFIX_.'htl_room_information` hri
INNER JOIN `'._DB_PREFIX_.'product` p
ON (p.`id_product` = hri.`id_product`)
WHERE p.`booking_product` = 1 '.
(!is_null($active) ? ' AND p.`active` ='.(int) $active : ' ').
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hri') : '');
(!is_null($active) ? ' AND p.`active` = '.(int) $active : '').
(!is_null($idProduct) ? ' AND hri.`id_product` = '.(int) $idProduct : '').
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hri') : '');
return Db::getInstance()->getValue($sql);
}