Просмотр исходного кода

feat(product): 添加商品SKU规格ID存储功能

- 新增specId字段用于存储SKU规格信息
- 优化gong_sku_id字段的数据类型处理
- 增加sku_id和spec_id字段到数据库插入操作
- 完善商品属性值表的数据映射关系
shichen месяцев назад: 3
Родитель
Сommit
fc672cf256
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      app/services/ThirdParty/AlibabaAgent/ProductService.php

+ 5 - 2
app/services/ThirdParty/AlibabaAgent/ProductService.php

@@ -591,6 +591,7 @@ class ProductService extends AlibabaAgentBaseService
591 591
             }
592 592
 
593 593
             $skuId = $sku['skuId'] ?? '';
594
+            $specId = $sku['specId'] ?? '';
594 595
             $unique = $this->generateUnique($productId, $skuId ?: $skuKey);
595 596
 
596 597
             Db::name('store_product_attr_value')->insert([
@@ -605,14 +606,16 @@ class ProductService extends AlibabaAgentBaseService
605 606
                 'stock'       => $sku['stock'] ?? 9999,
606 607
                 'cost_price'  => $sku['costPrice'] ?? 0,
607 608
                 'extension_one' => 5,
608
-                'gong_sku_id' => (string)$skuId,
609
+                'gong_sku_id' => $skuId,
609 610
                 'gong_mer_profit' => 0,
610 611
                 'gong_pension'    => 0,
611 612
                 'gong_market_price' => $sku['consignPrice'] ?? 0,
612 613
                 'plate_mer_profit' => 0,
613 614
                 'volume' => 0,
614 615
                 'weight' => 0,
615
-                'dacang_price' => 0
616
+                'dacang_price' => 0,
617
+                'sku_id' => $skuId,
618
+                'spec_id' => $specId
616 619
             ]);
617 620
         }
618 621
     }