$category=Category::model()->findByPk(1);
$descendants=$category->descendants()->findAll();
Descedant::model()->updateAll(array('exist' => 0), 'category_id=1');
$category=Category::model()->findByPk(1);
$descendants=$category->descendants()->findAll();
$ids = array_map(function($descendant) {
return $descendant->id;
}, $descendants);
Category::model()->addInCondition('id', $ids)->updateAll(array('exist' => 0));