示例#1
0
 /**
  * 分类删除后,所有分类下的Gift的categoryId都修改为0
  */
 protected function afterDelete()
 {
     $model = new Gift();
     $attributes = array('categoryId' => 0);
     $condition = "categoryId={$this->id}";
     $model->updateAll($attributes, $condition);
 }