diff --git a/common/modules/product/models/Category.php b/common/modules/product/models/Category.php index aca9707..6bf3ac4 100755 --- a/common/modules/product/models/Category.php +++ b/common/modules/product/models/Category.php @@ -215,7 +215,12 @@ class Category extends \yii\db\ActiveRecord public function beforeDelete() { - print_r($this->products->deleteAll()); + + if(!empty($this->products)){ + foreach($this->products as $product){ + $product->delete(); + } + } die(); } -- libgit2 0.21.4