From 60a6b0fe2350ae08286cd698906547eca86f4597 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 19 Nov 2024 15:43:47 +0800 Subject: [PATCH] update --- app/hdl/member_center/hdl_user_management.go | 91 ++++++++++---------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/app/hdl/member_center/hdl_user_management.go b/app/hdl/member_center/hdl_user_management.go index 08fa5e6..099cf8a 100644 --- a/app/hdl/member_center/hdl_user_management.go +++ b/app/hdl/member_center/hdl_user_management.go @@ -6,7 +6,6 @@ import ( md "applet/app/md/institutional_management/member_center" svc "applet/app/svc/member_center" "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" - "code.fnuoos.com/EggPlanet/egg_models.git/src/model" "github.com/gin-gonic/gin" ) @@ -123,53 +122,53 @@ func UserManagementUpdateUserInfo(c *gin.Context) { return } - userDb := implement.NewUserDb(db.Db) + _ = implement.NewUserDb(db.Db) - var affected int64 - var err1 error - forceColumns := make([]string, 0) - user := model.User{ - Id: req.UID, - } - if req.Memo != "" { - user.Memo = req.Memo - forceColumns = append(forceColumns, "memo") - } - if req.Disable != false { - user.State = 2 - forceColumns = append(forceColumns, "state") - } - if req.LastLoginIp != "" { - user.LastLoginIp = req.LastLoginIp - forceColumns = append(forceColumns, "last_login_ip") - } - if req.Avatar != "" { - user.Avatar = req.Avatar - forceColumns = append(forceColumns, "avatar") - } - if len(forceColumns) > 0 { - affected, err1 = userDb.UserUpdate(req.UID, &user) - if err1 != nil { - e.OutErr(c, e.ERR_DB_ORM, err1.Error()) - return - } - } - - var err2 error - if req.Tag != 0 { - record := model.UserTagRecords{ - TagId: req.Tag, - } - recordsDb := implement.NewUserTagRecordsDb(db.Db) - affected, err2 = recordsDb.UserTagRecordsUpdate(req.UID, &record, "tag_id") - if err2 != nil { - e.OutErr(c, e.ERR_DB_ORM, err2.Error()) - return - } - - } + //var affected int64 + //var err1 error + //forceColumns := make([]string, 0) + //user := model.User{ + // Id: req.UID, + //} + //if req.Memo != "" { + // user.Memo = req.Memo + // forceColumns = append(forceColumns, "memo") + //} + //if req.Disable != false { + // user.State = 2 + // forceColumns = append(forceColumns, "state") + //} + //if req.LastLoginIp != "" { + // user.LastLoginIp = req.LastLoginIp + // forceColumns = append(forceColumns, "last_login_ip") + //} + //if req.Avatar != "" { + // user.Avatar = req.Avatar + // forceColumns = append(forceColumns, "avatar") + //} + //if len(forceColumns) > 0 { + // affected, err1 = userDb.UserUpdate(req.UID, &user) + // if err1 != nil { + // e.OutErr(c, e.ERR_DB_ORM, err1.Error()) + // return + // } + //} + // + //var err2 error + //if req.Tag != 0 { + // record := model.UserTagRecords{ + // TagId: req.Tag, + // } + // recordsDb := implement.NewUserTagRecordsDb(db.Db) + // affected, err2 = recordsDb.UserTagRecordsUpdate(req.UID, &record, "tag_id") + // if err2 != nil { + // e.OutErr(c, e.ERR_DB_ORM, err2.Error()) + // return + // } + // + //} - e.OutSuc(c, affected, nil) + e.OutSuc(c, 0, nil) } // UserManagementGetOneBasic