From 4c6cdc4e975dccc98c474e3ecaab58447b7d0a6f Mon Sep 17 00:00:00 2001 From: gazebo Date: Sun, 29 Sep 2019 17:19:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=88=9B=E5=BB=BA=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E6=B7=BB=E5=8A=A0=E4=BA=AC=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/act/act.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index bc80de6b2..aade8e146 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -74,6 +74,7 @@ func init() { func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Act, vendorIDs []int, actStoreSku []*ActStoreSkuParam) (validVendorIDs []int, actStoreSkuList []*model.ActStoreSku, actStoreSkuMapList []*model.ActStoreSkuMap, err error) { wholeValidVendorMap := make(map[int]int) + wholeValidVendorMap[model.VendorIDJX] = 1 if len(actStoreSku) > 0 { storeIDMap := make(map[int]int) skuIDMap := make(map[int]int) @@ -339,6 +340,10 @@ func PreCreateAct(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, actRu if err != nil { return nil, err } + if len(validVendorIDs) == 0 { + dao.Rollback(db) + return nil, fmt.Errorf("没有一个合法平台可以创建活动") + } preCreateActInfo = &tPreCreateActInfo{ ValidVendorIDs: validVendorIDs,