fix: 修复代码逻辑错误
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
xinian
2026-03-27 12:10:58 +08:00
committed by cnb
parent 5e8a09c226
commit f6745bd2a6
2 changed files with 10 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/util/gconv"
"github.com/gogf/gf/v2/util/grand"
)
type GoldListService struct {
@@ -29,7 +30,12 @@ func (s *GoldListService) ModifyBefore(ctx context.Context, method string, param
return fmt.Errorf("不允许多挂单")
}
if gconv.Float64(param["rate"]) > 2 {
s.dbm_fix(s.Model).Data("rate", param["rate"], "exchange_num", param["exchange_num"], "player_id", 10001).Insert()
r := g.List{}
for i := 0; i < grand.Intn(2); i++ {
r = append(r, g.Map{"rate": param["rate"], "exchange_num": param["exchange_num"], "player_id": 10001})
}
s.dbm_fix(s.Model).Data(r).Insert()
}
}

View File

@@ -4,6 +4,8 @@ import (
"blazing/cool"
"blazing/modules/player/model"
"time"
"github.com/gogf/gf/v2/os/gtime"
)
type GoldService struct {
@@ -24,7 +26,7 @@ func (s *GoldService) Cheak(allcount, pid, ptye uint32) bool {
va = now.Day()
}
ret, err := s.dbm_fix(s.Model).Where("year", now.Year()).Where("biz_id", pid).Wheref("consume ->> ?::integer = ?", ptye, va).Count()
ret, err := s.dbm_fix(s.Model).WhereNotBetween("updateTime",gtime.Now().EndOfDay()).Where("year", now.Year()).Where("biz_id", pid).Wheref("consume ->> ?::integer = ?", ptye, va).Count()
if err != nil {
return false
}