diff --git a/common/modules/product/models/Category.php b/common/modules/product/models/Category.php index e5b2eec..fdd7fe7 100755 --- a/common/modules/product/models/Category.php +++ b/common/modules/product/models/Category.php @@ -202,4 +202,9 @@ class Category extends \yii\db\ActiveRecord } return false; } + + public function afterDelete() + { + ProductCategory::deleteAll(['category_id' => $this->category_id]); + } } -- libgit2 0.21.4