调整
This commit is contained in:
parent
2d7ac5b109
commit
8bbfdd62c4
@ -163,8 +163,8 @@ func (ea *RechargeApi) RechargeQuery(c *gin.Context) {
|
|||||||
cursor := q5.SafeToInt64(reqJson.Cursor)
|
cursor := q5.SafeToInt64(reqJson.Cursor)
|
||||||
|
|
||||||
sql := fmt.Sprintf(`
|
sql := fmt.Sprintf(`
|
||||||
SELECT * FROM t_recharge
|
SELECT * FROM t_recharge_order
|
||||||
WHERE idx > %d AND net_id = %d AND passport = ?`,
|
WHERE idx > %d AND net_id = %d AND passport_address = ? AND pay_status = 1`,
|
||||||
cursor, netId)
|
cursor, netId)
|
||||||
|
|
||||||
params := []string{account}
|
params := []string{account}
|
||||||
@ -177,19 +177,20 @@ func (ea *RechargeApi) RechargeQuery(c *gin.Context) {
|
|||||||
ErrMsg string `json:"errmsg"`
|
ErrMsg string `json:"errmsg"`
|
||||||
Page common.StreamPagination `json:"page"`
|
Page common.StreamPagination `json:"page"`
|
||||||
Rows []struct {
|
Rows []struct {
|
||||||
OrderID string `json:"order_id"`
|
OrderID string `json:"order_id"`
|
||||||
TxHash string `json:"txhash"`
|
TxHash string `json:"txhash"`
|
||||||
NetID int64 `json:"net_id"`
|
NetID int64 `json:"net_id"`
|
||||||
Currency string `json:"currency"`
|
Currency string `json:"currency"`
|
||||||
Amount string `json:"amount"`
|
CurrencyName string `json:"currency_name"`
|
||||||
Diamond string `json:"diamond"`
|
Amount string `json:"amount"`
|
||||||
Date int32 `json:"createtime"`
|
Diamond string `json:"diamond"`
|
||||||
|
Date int32 `json:"createtime"`
|
||||||
} `json:"rows"`
|
} `json:"rows"`
|
||||||
}{}
|
}{}
|
||||||
q5.NewSlice(&rspObj.Rows, 0, 10)
|
q5.NewSlice(&rspObj.Rows, 0, 10)
|
||||||
|
|
||||||
f5.GetGoStyleDb().StreamPageQuery(
|
f5.GetGoStyleDb().StreamPageQuery(
|
||||||
constant.BCEVENT_DB,
|
constant.BCNFT_DB,
|
||||||
pageSize,
|
pageSize,
|
||||||
cursor,
|
cursor,
|
||||||
sql,
|
sql,
|
||||||
@ -203,10 +204,11 @@ func (ea *RechargeApi) RechargeQuery(c *gin.Context) {
|
|||||||
p := q5.NewSliceElement(&rspObj.Rows)
|
p := q5.NewSliceElement(&rspObj.Rows)
|
||||||
|
|
||||||
p.TxHash = ds.GetByName("txhash")
|
p.TxHash = ds.GetByName("txhash")
|
||||||
p.NetID = q5.SafeToInt64(ds.GetByName("net_id"))
|
p.NetID = netId
|
||||||
p.OrderID = ds.GetByName("order_id")
|
p.OrderID = ds.GetByName("order_id")
|
||||||
p.Currency = ds.GetByName("currency")
|
p.Currency = ds.GetByName("currency_address")
|
||||||
p.Amount = ds.GetByName("amount")
|
p.CurrencyName = ds.GetByName("currency_name")
|
||||||
|
p.Amount = ds.GetByName("price")
|
||||||
p.Diamond = ds.GetByName("diamond")
|
p.Diamond = ds.GetByName("diamond")
|
||||||
p.Date = q5.SafeToInt32(ds.GetByName("createtime"))
|
p.Date = q5.SafeToInt32(ds.GetByName("createtime"))
|
||||||
})
|
})
|
||||||
|
@ -98,12 +98,12 @@ func (this *UserApi) Info(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
var dbErr error
|
var dbErr error
|
||||||
sql := "SELECT SUM(diamond) FROM t_recharge WHERE passport = ? AND status = 0"
|
sql := "SELECT SUM(diamond) FROM t_recharge_order WHERE passport = ? AND pay_status = 1 AND delivery_status = 0;"
|
||||||
params := []string{
|
params := []string{
|
||||||
accountAddress,
|
accountAddress,
|
||||||
}
|
}
|
||||||
f5.GetGoStyleDb().RawQuery(
|
f5.GetGoStyleDb().RawQuery(
|
||||||
constant.BCEVENT_DB,
|
constant.BCNFT_DB,
|
||||||
sql,
|
sql,
|
||||||
params,
|
params,
|
||||||
func(err error, ds *f5.DataSet) {
|
func(err error, ds *f5.DataSet) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user