|
|
@@ -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 { |
|
|
|