feat: 添加金豆消费记录功能
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

添加金豆消费记录表和相关服务,用于记录用户金豆消耗明细
在购买逻辑中预留记录消费的注释位置
This commit is contained in:
xinian
2026-02-23 07:47:06 +08:00
committed by cnb
parent 84768e3406
commit 75cfc7bcb1
5 changed files with 27 additions and 13 deletions

View File

@@ -55,12 +55,6 @@ func (s *BaseSysUserService) SetdepartmentId(userId, departmentId uint32) (res *
// 单位是分
func (s *BaseSysUserService) UpdateGold(userId uint32, gold int64) {
// updateData := g.Map{
// "views": &gdb.Counter{
// Field: "goldbean",
// Value: 1,
// },
// }
if cool.Config.ServerInfo.IsVip != 0 {
cool.Logger.Info(context.TODO(), "测试服不操作金币")
@@ -68,10 +62,6 @@ func (s *BaseSysUserService) UpdateGold(userId uint32, gold int64) {
}
m := cool.DBM(s.Model).Where("id", userId)
m.Increment("goldbean", gold)
// // UPDATE `article` SET `views`=`views`+1 WHERE `id`=1
// result, err := db.Update("article", updateData, "id", 1)
//res.GoldBean, _ = alpacadecimal.NewFromFloat(float64(gold)).Div(alpacadecimal.NewFromFloat(100)).Float64()
}
func (s *BaseSysUserService) GetGold(userId uint) (res int64) {