if (is_array($ad)) {
if (isset($ad['role']) && $ad['role'] == User::ROLE_ADMIN) {
$sql = 'UPDATE {{apartment}} SET active = '.Apartment::STATUS_INACTIVE.' WHERE id = '.$ad['id'].' LIMIT 1';
Yii::app()->db->createCommand($sql)->execute();
}
else {
$sql = 'UPDATE {{apartment}} SET active = '.Apartment::STATUS_INACTIVE.', owner_active = '.Apartment::STATUS_INACTIVE.' WHERE id = '.$ad['id'].' LIMIT 1';
Yii::app()->db->createCommand($sql)->execute();
}
}
if (is_array($ad)) {
Apartment::model()->findByPk($ad['id'])->delete();
}
Apartment::model()->findByPk($ad['id'])->delete();
Вернуться в Вопросы и помощь по изменениям
Сейчас этот форум просматривают: Google [Bot] и гости: 22