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