- fix bug in updateStoreSkusWithoutSync
This commit is contained in:
@@ -280,9 +280,8 @@ func updateStoreSkusWithoutSync(ctx *jxcontext.Context, storeID int, skuBindInfo
|
||||
}
|
||||
}
|
||||
for _, v := range allBinds {
|
||||
inSkuBind := inSkuBinsMap[v.SkuID]
|
||||
inSkuBind := inSkuBinsMap[v.RealSkuID]
|
||||
var skuBind *model.StoreSkuBind
|
||||
// globals.SugarLogger.Debug(ok)
|
||||
if v.ID == 0 {
|
||||
if skuBindInfo.IsFocus == 1 {
|
||||
skuBind = &model.StoreSkuBind{
|
||||
@@ -358,7 +357,7 @@ func updateStoreSkusWithoutSync(ctx *jxcontext.Context, storeID int, skuBindInfo
|
||||
}
|
||||
}
|
||||
if skuBind != nil && num == 1 {
|
||||
needSyncIDMap[skuBind.ID] = 1
|
||||
needSyncIDMap[skuBind.SkuID] = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ func (v *VendorSync) SyncStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, vendo
|
||||
globals.SugarLogger.Debug("SyncStoresSkus")
|
||||
hint, err = v.LoopStoreVendors(ctx, db, vendorIDs, "SyncStoresSkus", isAsync, userName, func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||
handler := v.GetStoreHandler(batchItemList[0].(int))
|
||||
_, err = handler.SyncStoresSkus(db, storeIDs, skuIDs, false, userName)
|
||||
_, err = handler.SyncStoresSkus(ctx, t, db, storeIDs, skuIDs, false)
|
||||
return nil, err
|
||||
})
|
||||
return hint, err
|
||||
|
||||
Reference in New Issue
Block a user