修改质押查询
This commit is contained in:
parent
5cd05fa5c9
commit
11a0f72536
@ -8,13 +8,14 @@ import (
|
|||||||
. "main/global"
|
. "main/global"
|
||||||
"net/http"
|
"net/http"
|
||||||
"q5"
|
"q5"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *MarketApi) LockList(c *gin.Context) {
|
func (this *MarketApi) LockList(c *gin.Context) {
|
||||||
netId := q5.ToInt64(c.Param("net_id"))
|
netId := q5.ToInt64(c.Param("net_id"))
|
||||||
owner := c.Param("owner_address")
|
owner := strings.ToLower(c.Param("owner_address"))
|
||||||
reqJson := struct {
|
reqJson := struct {
|
||||||
PageSize interface{} `json:"page_size"`
|
PageSize interface{} `json:"page_size"`
|
||||||
Cursor interface{} `json:"cursor"`
|
Cursor interface{} `json:"cursor"`
|
||||||
@ -39,8 +40,9 @@ func (this *MarketApi) LockList(c *gin.Context) {
|
|||||||
pageSize := q5.AdjustRangeValue(q5.SafeToInt32(reqJson.PageSize), 1, 20)
|
pageSize := q5.AdjustRangeValue(q5.SafeToInt32(reqJson.PageSize), 1, 20)
|
||||||
cursor := q5.SafeToInt64(reqJson.Cursor)
|
cursor := q5.SafeToInt64(reqJson.Cursor)
|
||||||
sql := fmt.Sprintf(`
|
sql := fmt.Sprintf(`
|
||||||
SELECT * FROM t_nft WHERE idx > %d AND net_id = %d AND owner_address = '%s' AND owner_address = last_lock_address
|
SELECT A.idx, A.net_id, A.token_type, A.token_id, A.contract_address, B.status, B.event_data FROM t_nft A LEFT JOIN t_order B
|
||||||
`,
|
ON A.net_id = B.net_id AND A.contract_address = B.contract_address AND A.token_id = B.token_id
|
||||||
|
WHERE A.idx > %d AND A.net_id = %d AND A.last_owner_address= '%s' AND A.owner_address != '%[3]s' AND A.last_owner_address = A.last_lock_address`,
|
||||||
cursor, netId, owner)
|
cursor, netId, owner)
|
||||||
|
|
||||||
subFilters := []f5.DbQueryFilter{}
|
subFilters := []f5.DbQueryFilter{}
|
||||||
@ -97,6 +99,7 @@ SELECT * FROM t_nft WHERE idx > %d AND net_id = %d AND owner_address = '%s' AND
|
|||||||
p.ContractAddress = ds.GetByName("contract_address")
|
p.ContractAddress = ds.GetByName("contract_address")
|
||||||
p.TokenId = ds.GetByName("token_id")
|
p.TokenId = ds.GetByName("token_id")
|
||||||
p.Payload = map[string]interface{}{}
|
p.Payload = map[string]interface{}{}
|
||||||
|
q5.DecodeJson(ds.GetByName("event_data"), &p.Payload)
|
||||||
q5.AppendSlice(&nfts, p)
|
q5.AppendSlice(&nfts, p)
|
||||||
})
|
})
|
||||||
GetCacheMgr().GetNfts(nfts)
|
GetCacheMgr().GetNfts(nfts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user