From 5844c407e83d0fecdee91fa322ea0be794b985ef Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 13 Dec 2024 20:54:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consume/user_delete_consume.go | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/consume/user_delete_consume.go b/consume/user_delete_consume.go index 6cc84ab..bafa177 100644 --- a/consume/user_delete_consume.go +++ b/consume/user_delete_consume.go @@ -3,7 +3,6 @@ package consume import ( "applet/app/cfg" "applet/app/db" - "applet/app/e" utils2 "applet/app/utils" "applet/app/utils/logx" "applet/consume/md" @@ -89,10 +88,10 @@ func handleUserDeleteConsume(backEg *xorm.Engine, ch *rabbit.Channel, msgData [] exist, err := eg.Where("id=?", msg.Uid).Get(&user) if exist { backEg.Insert(&user) - has, err := eg.Where("id=?", msg.Uid).Delete(&model.User{}) - if has == 0 || err != nil { - return e.NewErr(400, "注销失败") - } + user.Phone = "" + user.State = 2 + user.Nickname = "注销用户" + time.Now().Format("2006-01-02 15:04:05") + db.Db.Where("id=?", user.Id).Cols("state,phone,nickname").Update(&user) } //2.用户关系链 //查出所有下级 @@ -150,28 +149,6 @@ func handleUserDeleteConsume(backEg *xorm.Engine, ch *rabbit.Channel, msgData [] _, err = eg.Where("parent_uid=?", msg.Uid).Delete(&model.UserRelate{}) _, err = eg.Where("uid=?", msg.Uid).Delete(&model.UserRelate{}) - //3.公排位置 - var publicPlatoonUserRelation model.PublicPlatoonUserRelation - exist, err = eg.Where("uid=?", msg.Uid).Get(&publicPlatoonUserRelation) - if exist { - backEg.Insert(&publicPlatoonUserRelation) - } - eg.Where("uid=?", msg.Uid).Delete(&model.PublicPlatoonUserRelation{}) - //4.用户余额 - var UserWallet model.UserWallet - exist, err = eg.Where("uid=?", msg.Uid).Get(&UserWallet) - if exist { - backEg.Insert(&UserWallet) - } - eg.Where("uid=?", msg.Uid).Delete(&model.UserWallet{}) - //5.用户积分 - var UserVirtualAmount []model.UserVirtualAmount - err = eg.Where("uid=?", msg.Uid).Find(&UserVirtualAmount) - if len(UserVirtualAmount) > 0 { - backEg.Insert(&UserVirtualAmount) - } - eg.Where("uid=?", msg.Uid).Delete(&model.UserVirtualAmount{}) - //6.用户实名信息 var UserRealNameAuth model.UserRealNameAuth exist, err = eg.Where("uid=?", msg.Uid).Get(&UserRealNameAuth) if exist {