add clan info to api
This commit is contained in:
parent
e5b83bb11c
commit
950340a04d
|
@ -233,9 +233,6 @@ func TotalClanStatsGET(md common.MethodData) common.CodeMessager {
|
|||
}
|
||||
//RETARD CODE HAHAAAA
|
||||
m, brr := strconv.ParseInt(string(md.Query("m")[11]), 10, 64)
|
||||
if brr != nil {
|
||||
fmt.Println(brr)
|
||||
}
|
||||
|
||||
n := "std"
|
||||
if m == 1 {
|
||||
|
@ -247,8 +244,6 @@ func TotalClanStatsGET(md common.MethodData) common.CodeMessager {
|
|||
} else {
|
||||
n = "std"
|
||||
}
|
||||
fmt.Println(n)
|
||||
|
||||
|
||||
for i := 0; i < len(r.Clans); i++ {
|
||||
var members clanMembersData
|
||||
|
@ -271,10 +266,6 @@ func TotalClanStatsGET(md common.MethodData) common.CodeMessager {
|
|||
WHERE clan = ? AND privileges & 1 = 1
|
||||
`, rid)
|
||||
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
members.Code = 200
|
||||
|
||||
if n == "std" {
|
||||
|
|
|
@ -234,6 +234,7 @@ type userFullResponse struct {
|
|||
PlayStyle int `json:"play_style"`
|
||||
FavouriteMode int `json:"favourite_mode"`
|
||||
Badges []singleBadge `json:"badges"`
|
||||
Clan singleClan `json:"clan"`
|
||||
CustomBadge *singleBadge `json:"custom_badge"`
|
||||
SilenceInfo silenceInfo `json:"silence_info"`
|
||||
CMNotes *string `json:"cm_notes,omitempty"`
|
||||
|
@ -367,6 +368,22 @@ LIMIT 1
|
|||
r.BanDate = nil
|
||||
r.Email = ""
|
||||
}
|
||||
rows, err = md.DB.Query("SELECT c.id, c.name, c.description, c.tag, c.icon FROM user_clans uc "+
|
||||
"LEFT JOIN clans c ON uc.clan = c.id WHERE user = ?", r.ID)
|
||||
if err != nil {
|
||||
md.Err(err)
|
||||
}
|
||||
|
||||
for rows.Next() {
|
||||
var clan singleClan
|
||||
err = rows.Scan(&clan.ID, &clan.Name, &clan.Description, &clan.Tag, &clan.Icon)
|
||||
if err != nil {
|
||||
md.Err(err)
|
||||
continue
|
||||
}
|
||||
r.Clan = clan
|
||||
}
|
||||
|
||||
|
||||
r.Code = 200
|
||||
return r
|
||||
|
@ -491,6 +508,21 @@ LIMIT 1
|
|||
r.BanDate = nil
|
||||
r.Email = ""
|
||||
}
|
||||
rows, err = md.DB.Query("SELECT c.id, c.name, c.description, c.tag, c.icon FROM user_clans uc "+
|
||||
"LEFT JOIN clans c ON uc.clan = c.id WHERE user = ?", r.ID)
|
||||
if err != nil {
|
||||
md.Err(err)
|
||||
}
|
||||
|
||||
for rows.Next() {
|
||||
var clan singleClan
|
||||
err = rows.Scan(&clan.ID, &clan.Name, &clan.Description, &clan.Tag, &clan.Icon)
|
||||
if err != nil {
|
||||
md.Err(err)
|
||||
continue
|
||||
}
|
||||
r.Clan = clan
|
||||
}
|
||||
|
||||
r.Code = 200
|
||||
return r
|
||||
|
@ -615,6 +647,21 @@ LIMIT 1
|
|||
r.BanDate = nil
|
||||
r.Email = ""
|
||||
}
|
||||
rows, err = md.DB.Query("SELECT c.id, c.name, c.description, c.tag, c.icon FROM user_clans uc "+
|
||||
"LEFT JOIN clans c ON uc.clan = c.id WHERE user = ?", r.ID)
|
||||
if err != nil {
|
||||
md.Err(err)
|
||||
}
|
||||
|
||||
for rows.Next() {
|
||||
var clan singleClan
|
||||
err = rows.Scan(&clan.ID, &clan.Name, &clan.Description, &clan.Tag, &clan.Icon)
|
||||
if err != nil {
|
||||
md.Err(err)
|
||||
continue
|
||||
}
|
||||
r.Clan = clan
|
||||
}
|
||||
|
||||
r.Code = 200
|
||||
return r
|
||||
|
|
Loading…
Reference in New Issue
Block a user