groupGame.go 426 Bytes
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package group_m

import "git.hilo.cn/hilo-common/domain"

// 获取游戏房
func GetGameGroupsMap(model *domain.Model) map[string]bool {
	res := make(map[string]bool)
	var rows []GroupInfo
	if err := model.DB().Model(GroupInfo{}).Where("is_game_room = 1").Find(&rows).Error; err != nil {
		model.Log.Errorf("GetGameGroupsMap fail:%v", err)
		return res
	}
	for _, v := range rows {
		res[v.ImGroupId] = true
	}
	return res
}