Update clan.go

This commit is contained in:
Alicia 2019-02-24 14:29:19 +00:00
parent 2b02e0eaea
commit e5b83bb11c

View File

@ -86,7 +86,7 @@ func AllClanStatsGET(md common.MethodData) common.CodeMessager {
rows *sql.Rows rows *sql.Rows
err error err error
) )
rows, err = md.DB.Query("SELECT id, name, description, icon FROM clans") rows, err = md.DB.Query("SELECT id, name, description, tag, icon FROM clans")
if err != nil { if err != nil {
md.Err(err) md.Err(err)
@ -95,7 +95,9 @@ func AllClanStatsGET(md common.MethodData) common.CodeMessager {
defer rows.Close() defer rows.Close()
for rows.Next() { for rows.Next() {
nc := clanLbSingle{} nc := clanLbSingle{}
err = rows.Scan(&nc.ID, &nc.Name, &nc.Description, &nc.Icon) err = rows.Scan(&nc.ID, &nc.Name, &nc.Description, &nc.Tag, &nc.Icon)
fmt.Println(rows)
fmt.Println(&nc.Tag)
if err != nil { if err != nil {
md.Err(err) md.Err(err)
} }
@ -125,7 +127,6 @@ func AllClanStatsGET(md common.MethodData) common.CodeMessager {
} }
fmt.Println(n) fmt.Println(n)
for i := 0; i < len(r.Clans); i++ { for i := 0; i < len(r.Clans); i++ {
var members clanMembersData var members clanMembersData
@ -190,7 +191,7 @@ func AllClanStatsGET(md common.MethodData) common.CodeMessager {
}) })
for i := 0; i < len(r.Clans); i++ { for i := 0; i < len(r.Clans); i++ {
r.Clans[i].Rank = i+1 r.Clans[i].Rank = i + 1
} }
return r return r
@ -198,6 +199,7 @@ func AllClanStatsGET(md common.MethodData) common.CodeMessager {
func TotalClanStatsGET(md common.MethodData) common.CodeMessager { func TotalClanStatsGET(md common.MethodData) common.CodeMessager {
var ( var (
r megaStats r megaStats