From a69b5b3772fce98187ea1a8d6ceeac65f98d02c6 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 7 Jan 2020 15:17:08 +0800 Subject: [PATCH] +Act.OverlapRule --- business/jxstore/act/act.go | 2 +- business/model/act.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index f80ada794..70a24c64c 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -167,7 +167,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) { + if act.OverlapRule == model.OverlapRuleNormal { effectActStoreSkuList, err := dao.GetEffectiveActStoreSkuInfo(db, 0, vendorIDs, act.Type, storeIDs, skuIDs, act.BeginAt, act.EndAt) if err != nil { globals.SugarLogger.Errorf("GetEffectiveActStoreSkuInfo can not get sku promotion info for error:%v", err) diff --git a/business/model/act.go b/business/model/act.go index 5ea7c0125..5094dd643 100644 --- a/business/model/act.go +++ b/business/model/act.go @@ -28,6 +28,9 @@ const ( ActCreateTypeAPI = 1 ActCreateTypeCallback = 2 ActCreateTypeSpider = 3 + + OverlapRuleNormal = 0 // 不允许重叠(重叠会报错) + OverlapRuleReplace = 1 // 相同活动类型,或秒杀替换直降 ) var ( @@ -63,6 +66,7 @@ type Act struct { LimitCount int `json:"limitCount"` // 每单限购数量 Source string `orm:"size(255)" json:"source"` CreateType int `json:"createType"` + OverlapRule int `json:"overlapRule"` PricePercentage int `json:"pricePercentage"` // 单品级活动才有效 BeginAt time.Time `orm:"type(datetime);index" json:"beginAt"` EndAt time.Time `orm:"type(datetime);index" json:"endAt"`