Sfoglia il codice sorgente

feat(product): 添加SKU和规格ID字段到产品价格数据

- 在产品价格数组中新增sku_id字段
- 在产品价格数组中新增spec_id字段
- 确保新字段具有默认空值保护
shichen 3 mesi fa
parent
commit
50cbcae745

+ 2 - 0
app/common/repositories/store/product/ProductRepository.php

@@ -503,6 +503,8 @@ class ProductRepository extends BaseRepository
503
                         'gong_mer_profit' => $value['gong_mer_profit'] ?? 0.00,
503
                         'gong_mer_profit' => $value['gong_mer_profit'] ?? 0.00,
504
                         'gong_market_price' => $value['gong_market_price'] ?? 0.00,
504
                         'gong_market_price' => $value['gong_market_price'] ?? 0.00,
505
                         'plate_mer_profit' => $value['plate_mer_profit'] ?? 0.00,
505
                         'plate_mer_profit' => $value['plate_mer_profit'] ?? 0.00,
506
+                        'sku_id' => $value['sku_id'] ?? null,
507
+                        'spec_id' => $value['spec_id'] ?? null,
506
                     ];
508
                     ];
507
                 }
509
                 }
508
                 if (!$pric) $pric = $value['price'];
510
                 if (!$pric) $pric = $value['price'];