🎨 🔥 统一 seed

This commit is contained in:
fumiama
2022-02-18 20:20:25 +08:00
parent 3838d74cb8
commit bd6925f2f1
7 changed files with 8 additions and 17 deletions

View File

@@ -8,7 +8,6 @@ import (
"os"
"strconv"
"strings"
"time"
"github.com/FloatTech/zbputils/web"
"github.com/jinzhu/gorm"
@@ -160,7 +159,6 @@ func (vdb *VtbDB) GetThirdCategory(firstIndex, secondIndex, thirdIndex int) Thir
// RandomVtb ...
func (vdb *VtbDB) RandomVtb() ThirdCategory {
db := (*gorm.DB)(vdb)
rand.Seed(time.Now().UnixNano())
var count int
var tc ThirdCategory
db.Model(&ThirdCategory{}).Count(&count).Offset(rand.Intn(count)).Take(&tc)