feat: 添加金豆消费记录功能
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

在购买金豆商品成功后记录消费信息,并简化消费记录模型字段
This commit is contained in:
xinian
2026-02-23 07:52:36 +08:00
committed by cnb
parent 75cfc7bcb1
commit c78e8e13c3
3 changed files with 17 additions and 3 deletions

View File

@@ -15,14 +15,12 @@ type GoldBeanConsume struct {
*cool.Model
PlayerID uint64 `gorm:"not null;uniqueIndex;index:idx_pet_by_player_id;comment:'所属玩家ID'" json:"player_id"`
ConsumeNum uint32 `gorm:"not null;default:0;comment:'金豆消费数量(非负数)'" json:"consume_num" description:"消费金豆数量"`
ConsumeNum uint32 `gorm:"not null;default:0;comment:'消费数量'" json:"consume_num" description:"消费数量"`
BizID uint32 `gorm:"not null;default:0;comment:'关联业务ID如道具ID/扭蛋池ID无则填0'" json:"biz_id" description:"关联业务ID"`
///消费年份
Year uint32 `gorm:"not null;default:0;comment:'消费年份'" json:"year" description:"消费年份"`
//消费时间,由月-周-日组成,判断金豆物品的购买重置周期
Consume []uint32 `gorm:"type:jsonb; comment:'消费时间'" json:"consume" description:"消费时间"`
BeforeBalance uint32 `gorm:"not null;default:0;comment:'消费前金豆余额'" json:"before_balance" description:"消费前余额"`
}
// -------------------------- 核心配套方法 --------------------------