Enhance product handling and seeding logic

- Added a call to sync properties JSON in UpdateProductRelations job if the method exists.
- Updated ProductFieldsForDetail to provide a default value of '-' for missing property values.
- Simplified the insertion logic in ProductPropertyValuesSeeder by replacing 'tm' with 'tk' in the value field and removed commented-out code for clarity.
This commit is contained in:
Mekan1206
2026-02-09 23:15:56 +05:00
parent 8f49fe0124
commit 9fac84a882
3 changed files with 10 additions and 17 deletions

View File

@@ -31,22 +31,10 @@ class ProductPropertyValuesSeeder extends Seeder
DB::table($table)->insert([
'id' => $data['id'],
'attribute_id' => $data['attribute_id'],
// "name": "{\"en\": \"8 GB\", \"ru\": \"8 GB\", \"tm\": \"8 GB\"}",
// "description": null,
// "string_value": "Ci4wU42HuY",
// "text_value": null,
// "integer_value": null,
// "float_value": null,
// "boolean_value": null,
// "date_value": null,
// "datetime_value": null,
// "json_value": null,
// "image_value": null,
// "file_value": null,
// "created_at": "2025-06-10 16:12:32",
// "updated_at": "2025-06-10 16:12:34"
'value' => str_replace('"tm"', '"tk"', $data['name']),
]);
// "string_value": "Ci4wU42HuY",
}
});
}