From d96f50058fabe0d6d33ad1d9a8d78974ed561887 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 12 Nov 2019 11:00:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=96=E6=B6=88=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E6=B4=BB=E5=8A=A8=E6=97=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/act/act.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index 9e78f07e1..f887f9a35 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -105,6 +105,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac } storeIDs := jxutils.IntMap2List(storeIDMap) skuIDs := jxutils.IntMap2List(skuIDMap) + // 判断活动是否重叠的检查,当前忽略京东平台及所有结算信息 if !(len(vendorIDs) == 1 && vendorIDs[0] == model.VendorIDJD || act.Type == model.ActSkuFake) { effectActStoreSkuList, err := dao.GetEffectiveActStoreSkuInfo(db, 0, vendorIDs, storeIDs, skuIDs, act.BeginAt, act.EndAt) if err != nil { @@ -150,7 +151,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac v.OriginalPrice = int64(jxPrice) } var err2 error - if act.Type != model.ActSkuFake { + if act.Type != model.ActSkuFake { // 非结算,要计算实际活动价格 if storeSkuInfo == nil { v.ErrMsg = fmt.Sprintf("门店:%d没有关注商品:%d", v.StoreID, v.SkuID) wrongSkuList = append(wrongSkuList, v) @@ -697,11 +698,13 @@ func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, act syncStatus = model.SyncFlagDeletedMask } syncStatus |= act.SyncStatus - if _, err = dao.UpdateEntityLogically(db, partner.Act2ActMap(act), - map[string]interface{}{ - model.FieldSyncStatus: syncStatus, - }, ctx.GetUserName(), nil); err != nil { - return err + if act.Type != model.ActSkuFake { + if _, err = dao.UpdateEntityLogically(db, partner.Act2ActMap(act), + map[string]interface{}{ + model.FieldSyncStatus: syncStatus, + }, ctx.GetUserName(), nil); err != nil { + return err + } } } if isDeleteAll != isNeedCancelAct { @@ -709,7 +712,7 @@ func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, act } } - if isNeedCancelAct && act.Type != model.ActSkuFake { + if isNeedCancelAct { act := &model.Act{} act.ID = actID if _, err = dao.UpdateEntityLogically(db, act,