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() }