From 5434ea033693083629810c044611bfb1ec3008e4 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 24 Jul 2019 16:50:05 +0800 Subject: [PATCH] =?UTF-8?q?-=20UpdateActStoreSkuBind=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E5=A4=84=E7=90=86=E8=BF=94=E5=9B=9E=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/act/act.go | 3 +-- controllers/act.go | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index 00ad28b1c..bba7cb4ec 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -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 diff --git a/controllers/act.go b/controllers/act.go index 05a1fef11..a4291e120 100644 --- a/controllers/act.go +++ b/controllers/act.go @@ -231,16 +231,20 @@ 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) }() - retVal, err = act.SyncAct(params.Ctx, nil, params.ActID, nil, nil, nil, params.IsAsync) + if err == nil { + retVal, err = act.SyncAct(params.Ctx, nil, params.ActID, nil, nil, nil, params.IsAsync) + } } } return retVal, "", err