pull/218/head
skiffer-git 3 years ago
parent 84aca5b9e1
commit bf5f72c00b

@ -1029,11 +1029,10 @@ func (s *groupServer) CancelMuteGroup(ctx context.Context, req *pbGroup.CancelMu
log.Error(req.OperationID, "verify failed ", req.OpUserID, req.GroupID)
return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil
}
groupInfo := db.Group{GroupID: req.GroupID}
err := imdb.UpdateGroupInfoDefaultZero(groupInfo, map[string]interface{}{"status": constant.GroupOk})
err := imdb.UpdateGroupInfoDefaultZero(req.GroupID, map[string]interface{}{"status": constant.GroupOk})
if err != nil {
log.Error(req.OperationID, "UpdateGroupInfoDefaultZero failed ", err.Error(), groupInfo)
log.Error(req.OperationID, "UpdateGroupInfoDefaultZero failed ", err.Error(), req.GroupID)
return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
}
chat.GroupCancelMutedNotification(req.OperationID, req.OpUserID, req.GroupID)

@ -216,10 +216,10 @@ func GetGroupMaster(groupId string) (db.GroupMember, error) {
return groupMember, nil
}
func UpdateGroupInfoDefaultZero(groupInfo db.Group, args map[string]interface{}) error {
func UpdateGroupInfoDefaultZero(groupID string, args map[string]interface{}) error {
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
if err != nil {
return err
}
return dbConn.Model(groupInfo).Updates(args).Error
return dbConn.Model(&db.Group{}).Where("group_id = ? ", groupID).Update(args).Error
}

Loading…
Cancel
Save