Merge pull request 'main' (#424) from main into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/424
This commit is contained in:
chenhao 2024-05-10 22:26:59 +08:00
commit 1659bace4e
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