From 783367d16f4f8fab28a7cd26284abd4aff22eddc Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 10 Dec 2024 19:27:22 +0800 Subject: [PATCH] update --- app/hdl/member_center/hdl_level__management.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/hdl/member_center/hdl_level__management.go b/app/hdl/member_center/hdl_level__management.go index 50b389e..9ee0727 100644 --- a/app/hdl/member_center/hdl_level__management.go +++ b/app/hdl/member_center/hdl_level__management.go @@ -254,10 +254,12 @@ func AddLevel(c *gin.Context) { } // 2. 创建任务信息 - err = svc.BatchAddLevelTask(session, req.UserLevelTasks, id) - if err != nil { - e.OutErr(c, e.ERR_DB_ORM, err.Error()) - return + if len(req.UserLevelTasks) > 0 { + err = svc.BatchAddLevelTask(session, req.UserLevelTasks, id) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } } err = session.Commit()