This commit is contained in:
yangduo 2024-08-20 17:48:57 +08:00
parent 8ad879c3ee
commit 40000afc7b

View File

@ -132,6 +132,7 @@ func (sa *StackingApi) DiamondRecordQuery(c *gin.Context) {
Date int32 `json:"date"`
Amount string `json:"amount"`
Type int32 `json:"type"`
From string `json:"from"`
}
rspObj := struct {
ErrCode int32 `json:"errcode"`
@ -140,7 +141,7 @@ func (sa *StackingApi) DiamondRecordQuery(c *gin.Context) {
}{}
{
sql := `SELECT * FROM t_diamond_consume_product WHERE account_id = ? OR passport_address = ? ORDER BY createtime DESC`
sql := `SELECT * FROM t_diamond_consume_product WHERE idx > 0 AND (account_id = ? OR passport_address = ?)`
params := []string{
accountAddress,
accountAddress,
@ -161,13 +162,14 @@ func (sa *StackingApi) DiamondRecordQuery(c *gin.Context) {
obj.Date = q5.SafeToInt32(ds.GetByName("createtime"))
obj.Amount = ds.GetByName("amount")
obj.Type = 1
obj.From = accountAddress
rspObj.Rows = append(rspObj.Rows, obj)
}
})
}
{
sql := `SELECT pay_time, diamond + present_diamond FROM t_recharge_order WHERE passport_address = ? AND pay_status = 1 ORDER BY createtime DESC`
sql := `SELECT pay_time, diamond + present_diamond, account_address FROM t_recharge_order WHERE idx > 0 AND passport_address = ? AND pay_status = 1`
params := []string{
accountAddress,
}
@ -186,6 +188,7 @@ func (sa *StackingApi) DiamondRecordQuery(c *gin.Context) {
obj.Date = q5.SafeToInt32(ds.GetByName("pay_time"))
obj.Amount = ds.GetByIndex(1)
obj.From = ds.GetByIndex(2)
obj.Type = 0
rspObj.Rows = append(rspObj.Rows, obj)
}