From 4aa10f2534a42c46979864602f2f2e0fb761d841 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 10 Dec 2024 19:40:11 +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 9ee0727..ada68d3 100644 --- a/app/hdl/member_center/hdl_level__management.go +++ b/app/hdl/member_center/hdl_level__management.go @@ -193,10 +193,12 @@ func UpdateLevel(c *gin.Context) { } // 2.2 添加更新后的任务 - err = svc.BatchAddLevelTask(session, req.UserLevelTasks, utils.StrToInt(req.LevelID)) - if err != nil { - e.OutErr(c, e.ERR_DB_ORM, err.Error()) - return + if len(req.UserLevelTasks) > 0 { + err = svc.BatchAddLevelTask(session, req.UserLevelTasks, utils.StrToInt(req.LevelID)) + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } } err = session.Commit()