From 6a7ff7a8ff7737287690648bed4bcda933be6193 Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Fri, 10 May 2024 10:17:07 +0800 Subject: [PATCH] add withdraw --- api/proto/vas/proto/vas.go | 4 +++- app/mix/dao/mysql.go | 41 +++++++++++++++++++++++++++++++++++ app/mix/service/logic/vas.go | 8 +++++++ app/mix/service/vasservice.go | 23 ++++++++++++++++++++ dbstruct/vas.sql | 1 + 5 files changed, 76 insertions(+), 1 deletion(-) diff --git a/api/proto/vas/proto/vas.go b/api/proto/vas/proto/vas.go index 41c1cfb7..c659122d 100644 --- a/api/proto/vas/proto/vas.go +++ b/api/proto/vas/proto/vas.go @@ -96,7 +96,9 @@ type WithdrawPageReq struct { } type WithdrawPageData struct { - WithdrawDiamonds int64 `json:"withdraw_diamonds"` // 可提现的钻石 + WithdrawDiamonds int64 `json:"withdraw_diamonds"` // 可提现的钻石 + Day7TotalDiamonds int64 `json:"day7_total_diamonds"` // 7天前0~24点总收益 + Day7TotalWithdrawDiamonds int64 `json:"day7_total_withdraw_diamonds"` // 7天前0~24点已结算总收益 } // 提现发送验证码 diff --git a/app/mix/dao/mysql.go b/app/mix/dao/mysql.go index ff7f05b3..a2497d7f 100644 --- a/app/mix/dao/mysql.go +++ b/app/mix/dao/mysql.go @@ -1158,3 +1158,44 @@ func (m *Mysql) CreateWithdrawDiamondsHis(ctx *gin.Context, tx *sqlx.Tx, h *dbst } return err } + +// 根据时间段获取收益钻石 +func (m *Mysql) GetIncomeList(ctx *gin.Context, tx *sqlx.Tx, mid, st, et int64) (list []*dbstruct.ConsumeHistory, err error) { + list = make([]*dbstruct.ConsumeHistory, 0) + tableName, err := m.ChTableName(&dbstruct.ConsumeHistory{Type: goproto.Int32(dbstruct.CHTypeIncome)}) + sqlStr := fmt.Sprintf("select order_id,`change` from %s where mid=? and ct>=? and ct