- handle len(allBinds) == 0 in updateStoresSkusWithoutSync

This commit is contained in:
gazebo
2019-01-12 11:03:42 +08:00
parent a6bbf3f582
commit 7902af7057

View File

@@ -522,6 +522,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBind
utils.DefaultTimeValue,
}
if err = dao.GetRows(db, &allBinds, sql, sqlParams...); err == nil {
if len(allBinds) > 0 {
// globals.SugarLogger.Debug(utils.Format4Output(allBinds, false))
inSkuBinsMap := make(map[int]*StoreSkuBindSkuInfo, len(inSkuBinds))
for _, v := range inSkuBinds {
@@ -616,6 +617,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBind
needSyncIDMap[skuBind.SkuID] = 1
}
}
}
} else {
dao.Rollback(db)
return nil, err