Archived
1

Squads and chats in DataCache, squads rework

Work in progress, bugs may vary
This commit is contained in:
2018-02-17 07:03:58 +04:00
parent 7af54a1b02
commit fef521e35b
25 changed files with 645 additions and 710 deletions

View File

@@ -13,12 +13,13 @@ func (s *Statistics) SquadStatictics(squadID int) string {
squadMembersWithInformation := []dbmapping.SquadPlayerFull{}
squadMembers := []dbmapping.SquadPlayer{}
squad, ok := c.Squader.GetSquadByID(squadID)
if !ok {
squad, err := c.DataCache.GetSquadByID(squadID)
if err != nil {
c.Log.Error(err.Error())
return "Невозможно получить информацию о данном отряде. Возможно, он пуст или произошла ошибка."
}
err := c.Db.Select(&squadMembers, c.Db.Rebind("SELECT * FROM squads_players WHERE squad_id=?"), squadID)
err = c.Db.Select(&squadMembers, c.Db.Rebind("SELECT * FROM squads_players WHERE squad_id=?"), squadID)
if err != nil {
c.Log.Error(err.Error())
return "Невозможно получить информацию о данном отряде. Возможно, он пуст или произошла ошибка."
@@ -38,7 +39,7 @@ func (s *Statistics) SquadStatictics(squadID int) string {
continue
}
fullInfo.Squad = squad
fullInfo.Squad = *squad
fullInfo.Player = *playerRaw
fullInfo.Profile = *profileRaw