Merge branch 'main' into feat-IRONFANS-117-Robin

This commit is contained in:
Leufolium 2024-05-10 18:56:35 +08:00
commit 0ef3755334
1 changed files with 18 additions and 14 deletions

View File

@ -670,21 +670,25 @@ func (s *Service) utilCancelAccountByMids(ctx *gin.Context, midList []int64) err
imageIds := make([]int64, 0)
imageIds = append(imageIds, cfg.AvatarImageId)
err = _DefaultAccount.OpUpdateByIds(ctx, &accountproto.OpUpdateByIdsReq{
Account: &dbstruct.Account{
Name: goproto.String(cfg.Name),
PhoneHash: goproto.String(cfg.PhoneHash),
MobilePhone: goproto.String(cfg.MobilePhone),
Avatar: &dbstruct.MediaComponent{
ImageIds: &imageIds,
for _, account := range accounts {
phoneHash := strings.ToLower(util.DerefString(account.PhoneHash))
err = _DefaultAccount.OpUpdate(ctx, &accountproto.OpUpdateReq{
Account: &dbstruct.Account{
Mid: account.Mid,
Name: goproto.String(cfg.Name),
PhoneHash: goproto.String(phoneHash),
MobilePhone: goproto.String(cfg.MobilePhone),
Avatar: &dbstruct.MediaComponent{
ImageIds: &imageIds,
},
Status: goproto.Int64(consts.AccountStatus_Cancelled),
},
Status: goproto.Int64(consts.AccountStatus_Cancelled),
},
Ids: midList,
})
if err != nil {
logger.Error("_DefaultAccount OpUpdateByIds fail, err: %v", err)
return err
})
if err != nil {
logger.Error("_DefaultAccount OpUpdate fail, err: %v", err)
return err
}
}
return nil