京东商城门店库存修改
This commit is contained in:
@@ -1526,11 +1526,6 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
|||||||
}
|
}
|
||||||
request.AddCookie(c)
|
request.AddCookie(c)
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
deadline := 1
|
|
||||||
d := time.Now().Add(time.Duration(deadline) * time.Second) // deadline max
|
|
||||||
ctx2, cancel := context.WithDeadline(context.Background(), d)
|
|
||||||
defer cancel()
|
|
||||||
request.WithContext(ctx2)
|
|
||||||
fmt.Println(request)
|
fmt.Println(request)
|
||||||
response, _ := client.Do(request)
|
response, _ := client.Do(request)
|
||||||
defer response.Body.Close()
|
defer response.Body.Close()
|
||||||
|
|||||||
@@ -169,7 +169,11 @@ func (p *PurchaseHandler) UpdateStoreSkusStatus(ctx *jxcontext.Context, vendorOr
|
|||||||
if vendorStoreID == model.JdShopMainVendorStoreID {
|
if vendorStoreID == model.JdShopMainVendorStoreID {
|
||||||
err = api.JdShopAPI.UpdateSkuStock(utils.Str2Int(v.VendorSkuID), stock)
|
err = api.JdShopAPI.UpdateSkuStock(utils.Str2Int(v.VendorSkuID), stock)
|
||||||
} else {
|
} else {
|
||||||
err = api.JdShopAPI.UpdateSkuSiteStock(utils.Str2Int(v.VendorSkuID), stock, utils.Str2Int(vendorStoreID))
|
storeSkus, err2 := dao.GetStoresSkusInfo(dao.GetDB(), []int{storeID}, []int{v.SkuID})
|
||||||
|
err = err2
|
||||||
|
if len(storeSkus) > 0 {
|
||||||
|
err = api.JdShopAPI.UpdateSkuSiteStock(storeSkus[0].JdsID, stock, utils.Str2Int(vendorStoreID))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user