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

feat(boss): 移除alpacadecimal依赖并修复伤害计算逻辑

移除了NewSeIdx_699中对alpacadecimal的依赖,
修复了技能伤害计算方式,不再使用最小值限制

fix(pet): 修正宠物服务中的代码格式和查询逻辑

修正了UPdatePrice方法中的代码格式问题,
为PetService添加了ListQueryOp配置,增加了免费和非VIP宠物的查询条件
```
This commit is contained in:
昔念
2026-03-14 01:02:36 +08:00
parent 47f806d112
commit 5ed58b1316
3 changed files with 15 additions and 5 deletions

View File

@@ -59,7 +59,7 @@ func (s *PetService) UPdatePrice(ctime uint32, Price uint32, is_sale uint32) err
}
var p model.Pet
s.dbm(s.Model).Where("catch_time", ctime).Scan(&p)
if p.SalePrice!=0&&p.SalePrice != Price && utils.IsToday(p.UpdateTime) { //说明要修改价格
if p.SalePrice != 0 && p.SalePrice != Price && utils.IsToday(p.UpdateTime) { //说明要修改价格
return fmt.Errorf("一天只允许改价一次")
}
res0, err := s.dbm(s.Model).
@@ -302,6 +302,18 @@ func NewPetService(userid uint32) *PetService {
userid: userid,
Service: &cool.Service{
Model: model.NewPet(),
ListQueryOp: &cool.QueryOp{
FieldEQ: []string{"player_id", "free", "is_sale"},
Where: func(ctx context.Context) [][]interface{} {
return [][]interface{}{
// {"player_id", userId, true},
{"free", 1, true},
{"is_vip", 0, true},
}
},
},
PageQueryOp: &cool.QueryOp{
FieldEQ: []string{"player_id", "free", "is_sale"},
Where: func(ctx context.Context) [][]interface{} {