This commit is contained in:
邹宗楠
2025-02-22 15:42:43 +08:00
parent 126176f0e6
commit 55a855013e
2 changed files with 12 additions and 9 deletions

View File

@@ -579,11 +579,11 @@ func ModifyPetOrderSkusStock(db *dao.DaoDB, order *model.GoodsOrder, isAdd bool)
dao.UpdateEntity(db, ss, "Stock", "UpdatedAt")
}
}
if _, err = cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, nil, 0, db, nil, storeIdList, false, skuIDList, nil, model.SyncFlagStockMask, true, true); err != nil {
globals.SugarLogger.Debugf("----ModifyPetOrderSkusStock Update err opther: %v", err)
if hit, err := cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, nil, 0, db, nil, storeIdList, false, skuIDList, nil, model.SyncFlagStockMask, true, true); err != nil {
globals.SugarLogger.Debugf("----ModifyPetOrderSkusStock Update err opther: %v , %s", err, hit)
}
if _, err = cms.SyncSkus(jxcontext.AdminCtx, nil, nil, []string{"309558"}, nil, skuIDList, true); err != nil {
globals.SugarLogger.Debugf("----ModifyPetOrderSkusStock Update err jd: %v", err)
if hit, err := cms.SyncSkus(jxcontext.AdminCtx, nil, nil, []string{"309558"}, nil, skuIDList, true); err != nil {
globals.SugarLogger.Debugf("----ModifyPetOrderSkusStock Update err jd: %v,%s", err, hit)
}
return err
}

View File

@@ -2200,12 +2200,15 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
setStoreSkuBindStatus(skuBind, model.SyncFlagSaleMask)
setStoreSkuBindStatus(skuBind, model.SyncFlagStockMask)
if tmpStatus == model.StoreSkuBindStatusNormal {
if skuBind.Stock == 0 && beego.BConfig.RunMode != model.ServerTypePet {
switch beego.BConfig.RunMode {
case model.ServerTypePet:
if inSkuBind.Stock != nil {
skuBind.Stock = *inSkuBind.Stock
} else {
skuBind.Stock = 0
}
default:
skuBind.Stock = model.MaxStoreSkuStockQty
} else if inSkuBind != nil {
skuBind.Stock = *inSkuBind.Stock
} else {
skuBind.Stock = 0
}
//下面这段很难受
{