This commit is contained in:
邹宗楠
2022-12-15 10:38:19 +08:00
parent 1dabf88f2b
commit 9b0b4adf01
2 changed files with 6 additions and 11 deletions

View File

@@ -175,20 +175,14 @@ func (p *PurchaseHandler) UpdateStoreSkusStatus(ctx *jxcontext.Context, vendorOr
func (p *PurchaseHandler) UpdateStoreSkusPrice(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
api := getAPI(vendorOrgCode, storeID, vendorStoreID)
for _, v := range storeSkuList {
//// 更新子品价格
//err = api.EditPrice(&sku_editPrice_request.SkuEditPriceParam{
// Price: v.VendorPrice,
// SkuId: utils.Str2Int64(v.VendorSkuAttrId),
// ProductId: utils.Str2Int64(v.VendorSkuID),
//})
//if err != nil {
// failedList = append(failedList, putils.GetErrMsg2FailedSingleList(v, err, storeID, model.VendorChineseNames[model.VendorIDDD], "同步子品价格异常")...)
//}
tiktokSkuId, failedList := getProductSkuId4UpdateStock(api, v, storeID)
if len(failedList) > 0 {
return failedList, err
}
//更新子品
err = api.EditPrice(&sku_editPrice_request.SkuEditPriceParam{
Price: v.VendorPrice,
SkuId: utils.Str2Int64(v.VendorSonSkuID),
SkuId: tiktokSkuId,
ProductId: utils.Str2Int64(v.VendorSkuID),
})
if err != nil {

View File

@@ -448,6 +448,7 @@ func getProductSkuId4UpdateStock(api *tiktokShop.API, skuInfo *partner.StoreSkuI
for _, v := range childrenSku.SpecPrices {
tiktokSkuId = v.SkuId
skuInfo.VendorSonSkuID = utils.Int64ToStr(v.SkuId)
return tiktokSkuId, nil
}