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