From e4f7bf57fe827b549141d218b4a7b93c972eb6a1 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 18 Feb 2019 22:01:11 +0800 Subject: [PATCH] - prevent storeID=0 in AddStoreVendorMap --- business/jxstore/cms/store.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 7a9de8878..91033bac0 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -428,6 +428,9 @@ func GetStoreVendorMaps(ctx *jxcontext.Context, db *dao.DaoDB, storeID int, vend } func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID int, storeMap *model.StoreMap) (outStoreMap *model.StoreMap, err error) { + if storeID == 0 { + return nil, fmt.Errorf("storeID不能为0") + } userName := ctx.GetUserName() if handler := CurVendorSync.GetStoreHandler(vendorID); handler != nil { store, err2 := handler.ReadStore(storeMap.VendorStoreID)