by Robin at 20240520

This commit is contained in:
Leufolium 2024-05-20 18:12:22 +08:00
parent 90d11b400e
commit 5eb15ae3a1
1 changed files with 14 additions and 0 deletions

View File

@ -685,6 +685,20 @@ func (s *Service) utilCancelAccountByMids(ctx *gin.Context, midList []int64) err
Status: goproto.Int64(consts.AccountStatus_Cancelled),
},
})
if qmgo.IsDup(err) {
err = _DefaultAccount.OpUpdate(ctx, &accountproto.OpUpdateReq{
Account: &dbstruct.Account{
Mid: account.Mid,
Name: goproto.String(cfg.Name),
PhoneHash: goproto.String(phoneHash + qmgo.NewObjectID().Hex()),
MobilePhone: goproto.String(cfg.MobilePhone),
Avatar: &dbstruct.MediaComponent{
ImageIds: &imageIds,
},
Status: goproto.Int64(consts.AccountStatus_Cancelled),
},
})
}
if err != nil {
logger.Error("_DefaultAccount OpUpdate fail, err: %v", err)
return err