From 96d28f32deafa2dd25f0f85d8e29a35468144222 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Tue, 30 Apr 2024 19:02:01 +0800 Subject: [PATCH] 1 --- app/admin/svc/svc_scheme.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/admin/svc/svc_scheme.go b/app/admin/svc/svc_scheme.go index d174a61..ac242ca 100644 --- a/app/admin/svc/svc_scheme.go +++ b/app/admin/svc/svc_scheme.go @@ -47,12 +47,13 @@ func SchemeBindEnterprise(req md.SchemeBindEnterpriseReq) (err error) { EnterpriseId: v, }) } - _, err = schemeEnterpriseDb.BatchAddSchemeEnterpriseBySession(session, mm) - if err != nil { - _ = session.Rollback() - return + if len(mm) > 0 { + _, err = schemeEnterpriseDb.BatchAddSchemeEnterpriseBySession(session, mm) + if err != nil { + _ = session.Rollback() + return + } } - return session.Commit() }