23 lines
465 B
Go
23 lines
465 B
Go
package helpers
|
|
|
|
import "synlotto-website/models"
|
|
|
|
func BuildBallsSlice(t models.Ticket) []int {
|
|
balls := []int{t.Ball1, t.Ball2, t.Ball3, t.Ball4, t.Ball5}
|
|
if t.GameType == "Lotto" && t.Ball6 > 0 {
|
|
balls = append(balls, t.Ball6)
|
|
}
|
|
return balls
|
|
}
|
|
|
|
func BuildBonusSlice(t models.Ticket) []int {
|
|
var bonuses []int
|
|
if t.Bonus1 != nil {
|
|
bonuses = append(bonuses, *t.Bonus1)
|
|
}
|
|
if t.Bonus2 != nil {
|
|
bonuses = append(bonuses, *t.Bonus2)
|
|
}
|
|
return bonuses
|
|
}
|