예제 #1
0
파일: Category.php 프로젝트: Penton/MoBlog
 public function afterDelete()
 {
     parent::afterDelete();
     //修改直接子类的父级id
     self::updateAll(['parent' => $this->parent], 'parent=:parent AND type=:type', [':parent' => $this->mid, ':type' => static::TYPE]);
     //删除和文章的关联
     Relationship::deleteAll(['mid' => $this->mid]);
 }
예제 #2
0
파일: Tag.php 프로젝트: Penton/MoBlog
 public function afterDelete()
 {
     parent::afterDelete();
     //删除和文章的关联
     Relationship::deleteAll(['mid' => $this->mid]);
 }