This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user