diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 0495639d7..3679f671d 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -2186,23 +2186,19 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs setStoreSkuBindStatus(skuBind, model.SyncFlagSaleMask) setStoreSkuBindStatus(skuBind, model.SyncFlagStockMask) if tmpStatus == model.StoreSkuBindStatusNormal { - globals.SugarLogger.Debugf("----------------------------5") - globals.SugarLogger.Debugf("---------------------------5skuBind %s", utils.Format4Output(&skuBind, false)) - globals.SugarLogger.Debugf("---------------------------5skuBind %s", utils.Format4Output(&inSkuBind, false)) if skuBind.Stock == 0 && beego.BConfig.RunMode != model.ServerTypePet { skuBind.Stock = model.MaxStoreSkuStockQty - } else { + } else if inSkuBind != nil { skuBind.Stock = *inSkuBind.Stock + } else { + skuBind.Stock = 0 } //下面这段很难受 { - globals.SugarLogger.Debugf("----------------------------6") //如果是京东关注,要去建商品 list1, _ := dao.GetStoresMapList(db, []int{model.VendorIDJD}, []int{storeID}, nil, model.StoreStatusAll, 1, "", "", "") //表示这个门店绑定了京东 if len(list1) > 0 { - globals.SugarLogger.Debugf("-----------------%s", utils.Format4Output(list1, false)) - globals.SugarLogger.Debugf("---------------v--%s", utils.Format4Output(v, false)) vendorOrgCodes, _ := dao.GetVendorOrgCode(db, model.VendorIDJD, list1[0].VendorOrgCode, model.VendorOrgTypePlatform) //thingmap里肯定存在,再判断有没有同步上去 thingMaps, _ := dao.GetThingMapList(db, model.ThingTypeSku, []int{model.VendorIDJD}, []int{v.RealSkuID}, []string{list1[0].VendorOrgCode})