Export teams.json
This commit is contained in:
parent
664d78f913
commit
47610f0e2a
2 changed files with 46 additions and 1 deletions
|
|
@ -71,6 +71,16 @@ func (t Team) Delete() (int64, error) {
|
|||
}
|
||||
}
|
||||
|
||||
func (t Team) GetPoints() (int64, error) {
|
||||
var nb *int64
|
||||
err := DBQueryRow("SELECT SUM(E.gain) FROM exercice_solved S INNER JOIN exercices E ON E.id_exercice = S.id_exercice WHERE id_team = ?", t.Id).Scan(&nb)
|
||||
if nb != nil {
|
||||
return *nb, err
|
||||
} else {
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
|
||||
func (t Team) HasAccess(e Exercice) bool {
|
||||
if e.Depend == nil {
|
||||
return true
|
||||
|
|
|
|||
Reference in a new issue