- updateStoresSkusWithoutSync中的事务按单门店来
This commit is contained in:
@@ -619,14 +619,14 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBind
|
||||
|
||||
userName := ctx.GetUserName()
|
||||
needSyncIDMap := make(map[int]int)
|
||||
dao.Begin(db)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
dao.Rollback(db)
|
||||
panic(r)
|
||||
}
|
||||
}()
|
||||
for _, storeID := range storeIDs {
|
||||
dao.Begin(db)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
dao.Rollback(db)
|
||||
panic(r)
|
||||
}
|
||||
}()
|
||||
for _, skuBindInfo := range skuBindInfos {
|
||||
inSkuBinds := skuBindInfo.Skus
|
||||
var allBinds []*tStoreSkuBindAndSpec
|
||||
@@ -774,8 +774,8 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBind
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
dao.Commit(db)
|
||||
}
|
||||
dao.Commit(db)
|
||||
skuIDs := jxutils.IntMap2List(needSyncIDMap)
|
||||
return skuIDs, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user