判断只判断三平台

This commit is contained in:
苏尹岚
2020-08-24 08:56:31 +08:00
parent c127dda6cc
commit 51ef1c291c

View File

@@ -1159,6 +1159,10 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend
} else {
err = ErrCanNotFindVendor
}
storeDetail, _ := dao.GetStoreDetailByVendorStoreID(db, storeMap.VendorStoreID, storeMap.VendorID)
if storeDetail != nil {
return nil, fmt.Errorf("此平台门店ID已在京西有绑定请先解除绑定平台门店ID :[%v]", storeMap.VendorStoreID)
}
} else if vendorID == model.VendorIDJX {
ReCalculateJxPriceLight(db, ctx, storeID)
} else if vendorID == model.VendorIDYB {
@@ -1186,10 +1190,6 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend
}
}
}
storeDetail, _ := dao.GetStoreDetailByVendorStoreID(db, storeMap.VendorStoreID, storeMap.VendorID)
if storeDetail != nil {
return nil, fmt.Errorf("此平台门店ID已在京西有绑定请先解除绑定平台门店ID :[%v]", storeMap.VendorStoreID)
}
storeMapList, err := dao.GetStoresMapList2(db, []int{vendorID}, []int{storeID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", true)
if len(storeMapList) > 0 {
_, err = CurVendorSync.SyncStore(ctx, db, storeMap.VendorID, storeID, false, userName)