Commit b5a906ef2b8be6c21e7f6c157045b410ad033261
1 parent
cac3c9f7
20.07.16
Showing
6 changed files
with
87 additions
and
0 deletions
Show diff stats
common/modules/product/models/Product.php
| @@ -4,6 +4,7 @@ namespace common\modules\product\models; | @@ -4,6 +4,7 @@ namespace common\modules\product\models; | ||
| 4 | 4 | ||
| 5 | use common\behaviors\Slug; | 5 | use common\behaviors\Slug; |
| 6 | use common\models\ProductToRating; | 6 | use common\models\ProductToRating; |
| 7 | +use common\models\Share; | ||
| 7 | use common\modules\comment\models\Comment; | 8 | use common\modules\comment\models\Comment; |
| 8 | use common\modules\product\behaviors\FilterBehavior; | 9 | use common\modules\product\behaviors\FilterBehavior; |
| 9 | use common\modules\rubrication\models\TaxGroup; | 10 | use common\modules\rubrication\models\TaxGroup; |
| @@ -331,6 +332,11 @@ class Product extends \yii\db\ActiveRecord | @@ -331,6 +332,11 @@ class Product extends \yii\db\ActiveRecord | ||
| 331 | ProductImage::deleteAll(['product_id' => $this->product_id]); | 332 | ProductImage::deleteAll(['product_id' => $this->product_id]); |
| 332 | ProductCategory::deleteAll(['product_id' => $this->product_id]); | 333 | ProductCategory::deleteAll(['product_id' => $this->product_id]); |
| 333 | ProductVariant::deleteAll(['product_id' => $this->product_id]); | 334 | ProductVariant::deleteAll(['product_id' => $this->product_id]); |
| 335 | + ProductOption::deleteAll(['product_id' => $this->product_id]); | ||
| 336 | + ProductVariantOption::deleteAll(['product_id' => $this->product_id]); | ||
| 337 | + ProductStock::deleteAll(['product_id' => $this->product_id]); | ||
| 338 | + Share::deleteAll(['product_id' => $this->product_id]); | ||
| 339 | + return true; | ||
| 334 | } | 340 | } |
| 335 | 341 | ||
| 336 | public function imagesUpload() | 342 | public function imagesUpload() |
composer_2.phar deleted
No preview for this file type
console/migrations/m160722_150612_remove_option_product_variant_id.php
0 โ 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +use yii\db\Migration; | ||
| 4 | + | ||
| 5 | +class m160722_150612_remove_option_product_variant_id extends Migration | ||
| 6 | +{ | ||
| 7 | + public function up() | ||
| 8 | + { | ||
| 9 | + $this->dropForeignKey('option_product_variant_id', '{{%product_variant_option}}'); | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + public function down() | ||
| 13 | + { | ||
| 14 | + return false; | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + /* | ||
| 18 | + // Use safeUp/safeDown to run migration code within a transaction | ||
| 19 | + public function safeUp() | ||
| 20 | + { | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + public function safeDown() | ||
| 24 | + { | ||
| 25 | + } | ||
| 26 | + */ | ||
| 27 | +} |
console/migrations/m160725_154511_remove_product_option_product_fkey.php
0 โ 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +use yii\db\Migration; | ||
| 4 | + | ||
| 5 | +class m160725_154511_remove_product_option_product_fkey extends Migration | ||
| 6 | +{ | ||
| 7 | + public function up() | ||
| 8 | + { | ||
| 9 | + $this->dropForeignKey('product_option_product_fkey', '{{%product_option}}'); | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + public function down() | ||
| 13 | + { | ||
| 14 | + return false; | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + /* | ||
| 18 | + // Use safeUp/safeDown to run migration code within a transaction | ||
| 19 | + public function safeUp() | ||
| 20 | + { | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + public function safeDown() | ||
| 24 | + { | ||
| 25 | + } | ||
| 26 | + */ | ||
| 27 | +} |
console/migrations/m160725_155127_remove_product_stock_product_variant_id_fkey.php
0 โ 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +use yii\db\Migration; | ||
| 4 | + | ||
| 5 | +class m160725_155127_remove_product_stock_product_variant_id_fkey extends Migration | ||
| 6 | +{ | ||
| 7 | + public function up() | ||
| 8 | + { | ||
| 9 | + $this->dropForeignKey('product_stock_product_variant_id_fkey', '{{%product_stock}}'); | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + public function down() | ||
| 13 | + { | ||
| 14 | + return false; | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + /* | ||
| 18 | + // Use safeUp/safeDown to run migration code within a transaction | ||
| 19 | + public function safeUp() | ||
| 20 | + { | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + public function safeDown() | ||
| 24 | + { | ||
| 25 | + } | ||
| 26 | + */ | ||
| 27 | +} |
frontend/web/images/no_photo.png deleted
9.21 KB