This commit is contained in:
2024-12-28 05:44:25 +08:00
parent 27a390f0d6
commit cb4bd0ad1f
2 changed files with 8 additions and 1 deletions

View File

@@ -131,7 +131,7 @@ var CollectionItems = &graphql.Field{
t = "image" t = "image"
} }
if err := db.Table("web_collect").Limit(3).Where("explorer_id = ?", item.ID).Find(&data).Error; err != nil { if err := db.Table("web_collect").Select("collect_id AS id").Limit(3).Where("explorer_id = ?", item.ID).Find(&data).Error; err != nil {
fmt.Println("获取封面ID失败", err) fmt.Println("获取封面ID失败", err)
} }

View File

@@ -234,3 +234,10 @@ var orderType = graphql.NewEnum(graphql.EnumConfig{
}, },
}, },
}) })
type Cache struct {
time time.Time
ids []string
}
var cache map[string]Cache = make(map[string]Cache)