1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-13 22:57:05 +08:00
parent d258274322
commit e5c75f7359
51 changed files with 230 additions and 254 deletions

View File

@@ -6,7 +6,6 @@ import (
"blazing/cool"
"blazing/modules/config/model"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/util/grand"
)
@@ -19,7 +18,7 @@ type ItemService struct {
func (s *ItemService) GetItemCount(id uint32) data.ItemInfo {
var item model.ItemGift
var res data.ItemInfo
dbm(s.Model).Where("id", id).Where("is_enabled", 1).Scan(&item)
dbm(s.Model).Where("id", id).Scan(&item)
if item.ItemID == 0 {
@@ -36,11 +35,7 @@ func (s *ItemService) GetItemCount(id uint32) data.ItemInfo {
}
func (s *ItemService) GetEgg(count int64) []data.ItemInfo {
var item []model.ItemGift
cool.DBM(s.Model).Where("is_egg", 1).Where("is_enabled", 1).Cache(gdb.CacheOption{
// Duration: time.Hour,
Force: false,
}).Scan(&item)
dbm(s.Model).Where("is_egg", 1).Scan(&item)
rr := utils.RandomSlice(item, int(count))
var res = make([]data.ItemInfo, len(rr))