From b0ffdd6a8543a608257b65b405bfbe0f29adaaf7 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Mon, 30 Sep 2024 21:21:37 +0800 Subject: [PATCH] update --- app/svc/svc_wx_data.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/svc/svc_wx_data.go b/app/svc/svc_wx_data.go index f3287c5..2c286a9 100644 --- a/app/svc/svc_wx_data.go +++ b/app/svc/svc_wx_data.go @@ -152,11 +152,13 @@ func GenerateWxAdData(req md.GenerateWxAdData) (err error, generateWxAdData mode UpdateAt: now.Format("2006-01-02 15:04:05"), }) } - generateWxAdDataWithAgentFlowDb := implement.NewGenerateWxAdDataWithAgentFlowDb(db.Db) - _, err = generateWxAdDataWithAgentFlowDb.BatchAddGenerateWxAdDataWithAgentFlow(session, generateWxAdDataWithAgentFlows) - if err != nil { - _ = session.Rollback() - return + if len(generateWxAdDataWithAgentFlows) > 0 { + generateWxAdDataWithAgentFlowDb := implement.NewGenerateWxAdDataWithAgentFlowDb(db.Db) + _, err = generateWxAdDataWithAgentFlowDb.BatchAddGenerateWxAdDataWithAgentFlow(session, generateWxAdDataWithAgentFlows) + if err != nil { + _ = session.Rollback() + return + } } // 6、修改 original_wx_ad_data 记录中的 is_apply(是否已应用(0:未 1:已) )