1
0

update cp

This commit is contained in:
syui 2023-04-09 22:54:51 +09:00
parent 311f1ae71a
commit ab66b9efc0
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56
2 changed files with 10 additions and 9 deletions

View File

@ -59,7 +59,7 @@ var (
{Name: "password", Type: field.TypeString}, {Name: "password", Type: field.TypeString},
{Name: "created_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime, Nullable: true},
{Name: "updated_at", Type: field.TypeTime, Nullable: true}, {Name: "updated_at", Type: field.TypeTime, Nullable: true},
{Name: "next", Type: field.TypeString, Nullable: true, Default: "20230409"}, {Name: "next", Type: field.TypeString, Nullable: true, Default: "20230410"},
{Name: "group_users", Type: field.TypeInt, Nullable: true}, {Name: "group_users", Type: field.TypeInt, Nullable: true},
} }
// UsersTable holds the schema information for the "users" table. // UsersTable holds the schema information for the "users" table.

View File

@ -36,14 +36,15 @@ func (Card) Fields() []ent.Field {
} else { } else {
card = 0 card = 0
} }
if card == 13 { if card == 13 {
card = 14 card = 1
} }
// 2023/04/09 premium card id:15 // 2023/04/09 premium card id:15
//if card == 15 { if card == 15 {
// card = 1 card = 1
//} }
card = 15
return card return card
}). }).
Optional(), Optional(),
@ -71,13 +72,13 @@ func (Card) Fields() []ent.Field {
rand.Seed(time.Now().UnixNano()) rand.Seed(time.Now().UnixNano())
var cp = 1 + rand.Intn(100) var cp = 1 + rand.Intn(100)
if cp == 2 { if cp == 2 {
cp = 50 + rand.Intn(100) cp = 50 + rand.Intn(150)
} }
if card >= 1 { if card >= 1 {
cp = 50 + cp + rand.Intn(200) cp = 150 + cp + rand.Intn(300)
} }
if super == "super" { if super == "super" {
cp = 200 + cp + rand.Intn(300) cp = 300 + cp + rand.Intn(500)
} }
return cp return cp