Commit 4c251a1e7b85985273f4b9429a398d9d84a15ffc
1 parent
6383abf9
add variantSku
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
models/Product.php
| ... | ... | @@ -429,7 +429,7 @@ |
| 429 | 429 | public function getCategories() |
| 430 | 430 | { |
| 431 | 431 | return $this->hasMany(Category::className(), [ 'id' => 'category_id' ]) |
| 432 | - ->viaTable('product_category', [ 'product_id' => 'id' ]); | |
| 432 | + ->viaTable('product_category', [ 'product_id' => 'id' ])->inverseOf('products'); | |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | /** | ... | ... |