- UpdateActStoreSkuBind正确处理返回错误
This commit is contained in:
@@ -572,7 +572,7 @@ func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, act
|
||||
}
|
||||
act := actMap[partner.GetVendorIDsFromActMap(actMap)[0]]
|
||||
if act.Status != model.ActStatusCreated || time.Now().Sub(act.EndAt) > 0 {
|
||||
return fmt.Errorf("当前活动状态:%s不能进行此操作,或已过期", model.ActStatusName[act.Status])
|
||||
return fmt.Errorf("当前活动状态:%s,不能进行此操作,或已过期", model.ActStatusName[act.Status])
|
||||
}
|
||||
|
||||
dao.Begin(db)
|
||||
@@ -584,7 +584,6 @@ func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, act
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
actStoreSkuParamMap := make(map[int64]*ActStoreSkuParam)
|
||||
for _, v := range actStoreSkuParam {
|
||||
actStoreSkuParamMap[jxutils.Combine2Int(v.StoreID, v.SkuID)] = v
|
||||
|
||||
@@ -231,18 +231,22 @@ func (c *ActController) UpdateActStoreSkuBind() {
|
||||
if len(actStoreSkuAddList) > 0 {
|
||||
if err = act.AddActStoreSkuBind(params.Ctx, db, params.ActID, actStoreSkuAddList); err != nil {
|
||||
dao.Rollback(db)
|
||||
return
|
||||
}
|
||||
}
|
||||
if len(actStoreSkuDeleteList) > 0 {
|
||||
if err = act.DeleteActStoreSkuBind(params.Ctx, db, params.ActID, actStoreSkuDeleteList); err != nil {
|
||||
dao.Rollback(db)
|
||||
return
|
||||
}
|
||||
}
|
||||
dao.Commit(db)
|
||||
}()
|
||||
if err == nil {
|
||||
retVal, err = act.SyncAct(params.Ctx, nil, params.ActID, nil, nil, nil, params.IsAsync)
|
||||
}
|
||||
}
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user