/** * 添加数据删除事件afterDelete * * @author wushuiyong */ public function afterDelete() { parent::afterDelete(); // 删除所有该项目的关系 Group::deleteAll(['project_id' => $this->attributes['id']]); // 删除本地目录 }