diff --git a/server/marketserver/api/v1/activity/stacking.go b/server/marketserver/api/v1/activity/stacking.go index a78a3376..24d28888 100644 --- a/server/marketserver/api/v1/activity/stacking.go +++ b/server/marketserver/api/v1/activity/stacking.go @@ -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) }