浏览代码

注销

master
huangjiajun 1周前
父节点
当前提交
5844c407e8
共有 1 个文件被更改,包括 4 次插入27 次删除
  1. +4
    -27
      consume/user_delete_consume.go

+ 4
- 27
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 {


正在加载...
取消
保存