扫码创建商品优化

This commit is contained in:
苏尹岚
2020-04-01 17:09:47 +08:00
parent e439b8d331
commit fc532c861b

View File

@@ -4218,7 +4218,10 @@ func CreateSkusAndFocusFromWx(ctx *jxcontext.Context, productInfo *jdapi.Product
IsSale: 1,
}
skuBindInfos = append(skuBindInfos, skuBindInfo)
UpdateStoresSkusByBind(ctx, nil, skuBindInfos, true, true)
_, err := UpdateStoresSkusByBind(ctx, nil, skuBindInfos, true, true)
if err != nil {
err = nil
}
}
skuNames, err := dao.GetSkuNames(db, nil, []string{productInfo.UpcCode}, "")
if err != nil {
@@ -4229,6 +4232,9 @@ func CreateSkusAndFocusFromWx(ctx *jxcontext.Context, productInfo *jdapi.Product
if err != nil {
return err
}
if productInfo.Name == "" {
return fmt.Errorf("暂时无法创建此商品,[%v]", productInfo.Name)
}
if len(skuNames2) > 1 {
return fmt.Errorf("此商品名在京西库中查询出了大于1个商品[%v]", productInfo.Name)
}