New admin triggers for db maintenance, updating display of prize results and logic fix
This commit is contained in:
@@ -2,8 +2,45 @@ package rules
|
||||
|
||||
import "synlotto-website/models"
|
||||
|
||||
var ThunderballPrizeRules = []models.PrizeRule{
|
||||
{Game: "Thunderball", MainMatches: 5, BonusMatches: 1, Tier: "Jackpot"},
|
||||
{Game: "Thunderball", MainMatches: 5, BonusMatches: 0, Tier: "Second"},
|
||||
{Game: "Thunderball", MainMatches: 4, BonusMatches: 1, Tier: "Third"},
|
||||
type PrizeInfo struct {
|
||||
Tier string
|
||||
Amount float64
|
||||
Label string
|
||||
}
|
||||
|
||||
var ThunderballPrizeRules = []models.PrizeRule{
|
||||
{Game: "Thunderball", MainMatches: 0, BonusMatches: 1, Tier: "Tier 1"},
|
||||
{Game: "Thunderball", MainMatches: 1, BonusMatches: 1, Tier: "Tier 2"},
|
||||
{Game: "Thunderball", MainMatches: 2, BonusMatches: 1, Tier: "Tier 3"},
|
||||
{Game: "Thunderball", MainMatches: 3, BonusMatches: 0, Tier: "Tier 4"},
|
||||
{Game: "Thunderball", MainMatches: 3, BonusMatches: 1, Tier: "Tier 5"},
|
||||
{Game: "Thunderball", MainMatches: 4, BonusMatches: 0, Tier: "Tier 6"},
|
||||
{Game: "Thunderball", MainMatches: 4, BonusMatches: 1, Tier: "Tier 7"},
|
||||
{Game: "Thunderball", MainMatches: 5, BonusMatches: 0, Tier: "Second"},
|
||||
{Game: "Thunderball", MainMatches: 5, BonusMatches: 1, Tier: "Jackpot"},
|
||||
}
|
||||
|
||||
func GetThunderballPrizeIndex(main, bonus int) (int, bool) {
|
||||
switch {
|
||||
case main == 5 && bonus == 1:
|
||||
return 9, true
|
||||
case main == 5 && bonus == 0:
|
||||
return 8, true
|
||||
case main == 4 && bonus == 1:
|
||||
return 7, true
|
||||
case main == 4 && bonus == 0:
|
||||
return 6, true
|
||||
case main == 3 && bonus == 1:
|
||||
return 5, true
|
||||
case main == 3 && bonus == 0:
|
||||
return 4, true
|
||||
case main == 2 && bonus == 1:
|
||||
return 3, true
|
||||
case main == 1 && bonus == 1:
|
||||
return 2, true
|
||||
case main == 0 && bonus == 1:
|
||||
return 1, true
|
||||
default:
|
||||
return 0, false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user