$apartmentInfo = Apartment::model()->findByPk($id, array('select' => 'owner_id, phone'));
$phone = $apartmentInfo->phone;
if (!$phone && $apartmentInfo->owner_id && param('useShowUserInfo')){
$userInfo = User::model()->findByPk($apartmentInfo->owner_id, array('select' => 'phone'));
$phone = $userInfo->phone;
}
$userInfo = $phone = null;
$apartmentInfo = Apartment::model()->findByPk($id, array('select' => 'owner_id, phone'));
if (!empty($apartmentInfo)) {
$phone = $apartmentInfo->phone;
}
if (!$phone && param('useShowUserInfo')){
if (!empty($apartmentInfo) && isset($apartmentInfo->owner_id)) {
$userInfo = User::model()->findByPk($apartmentInfo->owner_id, array('select' => 'phone'));
}
else {
$userInfo = User::model()->findByPk($id);
}
if (!empty($userInfo) && isset($userInfo->phone)) {
$phone = $userInfo->phone;
}
}
$data['propertyType']
HApartment::getTypesForSearch(true)
if ($filterPriceType) {
if (issetModule('seasonalprices') &&
in_array($filterPriceType, array(
Apartment::PRICE_PER_HOUR,
Apartment::PRICE_PER_DAY,
Apartment::PRICE_PER_WEEK,
Apartment::PRICE_PER_MONTH)
)) {
$whereCondition .= ' AND (a.id IN(SELECT DISTINCT(apartment_id) FROM {{seasonal_prices}} WHERE price_type = '.$filterPriceType.'))';
}
else {
$whereCondition .= ' AND a.price_type = '.$filterPriceType;
}
}
if ($filterPriceType) {
$whereCondition .= ' AND a.type = '.$filterPriceType;
}
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 36