All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
feat(boss-fight): 调整宠物战斗奖励逻辑 修复闪亮怪物奖励物品的位置,将奖励物品发放逻辑从条件判断前移到判断后, 确保只有符合条件的玩家才能获得玄铁奖励。 fix(player-energy): 修复能量时间消耗问题 注释掉EnergyTime的自动减1逻辑,避免玩家能量值异常减少。 refactor(shop-config): 优化商店查询配置 移除商品名称字段查询,只保留remark字段作为关键词搜索, 简化商品表的SELECT语句,提高查询效率。 ```
43 lines
758 B
Go
43 lines
758 B
Go
package service
|
|
|
|
import (
|
|
"blazing/cool"
|
|
"blazing/modules/config/model"
|
|
"context"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
)
|
|
|
|
type ShopService struct {
|
|
*cool.Service
|
|
}
|
|
|
|
func NewShopService() *ShopService {
|
|
return &ShopService{
|
|
&cool.Service{
|
|
Model: model.NewShopConfig(),
|
|
ListQueryOp: &cool.QueryOp{
|
|
Where: func(ctx context.Context) []g.Array {
|
|
return [][]interface{}{
|
|
|
|
{"is_enable", 1, true},
|
|
}
|
|
},
|
|
Select: "product_id,seerdou_price,jindou_price,remark",
|
|
},
|
|
|
|
PageQueryOp: &cool.QueryOp{
|
|
KeyWordField: []string{"remark"},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
func (s *ShopService) Get(product_id uint32) *model.ShopConfig {
|
|
m := dbm_enable(s.Model).Where("product_id", product_id)
|
|
var tt *model.ShopConfig
|
|
m.Scan(&tt)
|
|
|
|
return tt
|
|
|
|
}
|