1
0

fix card random

This commit is contained in:
syui 2024-05-17 10:02:08 +09:00
parent 823dc8d89c
commit 2b479451c1
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56
2 changed files with 3 additions and 1 deletions

View File

@ -202,7 +202,7 @@ var (
{Name: "ten_post", Type: field.TypeString, Nullable: true}, {Name: "ten_post", Type: field.TypeString, Nullable: true},
{Name: "ten_get", Type: field.TypeString, Nullable: true}, {Name: "ten_get", Type: field.TypeString, Nullable: true},
{Name: "ten_at", Type: field.TypeTime, Nullable: true}, {Name: "ten_at", Type: field.TypeTime, Nullable: true},
{Name: "next", Type: field.TypeString, Nullable: true, Default: "20240424"}, {Name: "next", Type: field.TypeString, Nullable: true, Default: "20240516"},
{Name: "room", Type: field.TypeInt, Nullable: true}, {Name: "room", Type: field.TypeInt, Nullable: true},
{Name: "model", Type: field.TypeBool, Nullable: true}, {Name: "model", Type: field.TypeBool, Nullable: true},
{Name: "model_at", Type: field.TypeTime, Nullable: true}, {Name: "model_at", Type: field.TypeTime, Nullable: true},

View File

@ -33,6 +33,8 @@ func (Card) Fields() []ent.Field {
var a = rand.Intn(20) var a = rand.Intn(20)
if a == 1 { if a == 1 {
card = rand.Intn(3) + 123 card = rand.Intn(3) + 123
} else if a == 2 {
card = rand.Intn(14) + 1
} else { } else {
card = 0 card = 0
} }