feat: #10000 商品编码优化

This commit is contained in:
赵世界 2023-07-18 14:12:20 +08:00
parent 6377f6561e
commit 4403cbc0db

View File

@ -97,6 +97,7 @@ class GoodsSkusImport implements ToCollection, SkipsEmptyRows
$hasGoods = ArrayUtils::index($hasGoods, 'goods_code');
foreach ($skus as &$newGoodsSku) {
$newGoodsSku['goods_id'] = isset($hasGoods[$newGoodsSku['goods_id']]) ? $hasGoods[$newGoodsSku['goods_id']]['id'] : $newGoodsSku['goods_id'];
$newGoodsSku['external_sku_id'] = isset($hasGoods[$newGoodsSku['goods_id']]) ? $hasGoods[$newGoodsSku['goods_id']]['goods_code'] . '_' . $newGoodsSku['sku_code'] : '';
}
unset($newGoodsSku);
}