Refactor product relations to use new category_product and channel_product tables
- Updated queries and relationships in various controllers and models to replace `product_has_relations` with `category_product` and `channel_product`. - Adjusted methods in `ProductFilterer`, `FilterParamsController`, and `FilterController` to reflect the new database structure. - Modified seeder to insert data into the new `channel_product` table. - Updated tests to ensure compatibility with the new product relation structure.
This commit is contained in:
1 parent
683fa5e0d9
commit
522ebdae34
15 files changed
+102
-48
No files matched your search
@@ -45,10 +45,9 @@ public function run()
|
||||
});
|
||||
|
||||
$channel = $user ? $user->channel() : tmpostChannel();
|
||||
DB::table('product_has_relations')->insert([
|
||||
DB::table('channel_product')->insert([
|
||||
'product_id' => $data['id'],
|
||||
'productable_id' => $channel->id,
|
||||
'productable_type' => 'channel',
|
||||
'channel_id' => $channel->id,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user