1
This commit is contained in:
parent
fe18a0554c
commit
48fb7c3b08
@ -118,19 +118,12 @@ func (this *AssetApi) Listing(c *gin.Context) {
|
||||
cursor := q5.ToInt64(c.DefaultQuery("cursor", ""))
|
||||
netId := q5.ToInt64(c.Param("net_id"))
|
||||
accountAddress := strings.ToLower(c.Param("account_address"))
|
||||
filterType := q5.ToInt32(c.DefaultQuery("type", ""))
|
||||
searchName := c.DefaultQuery("search_name", "")
|
||||
sql := fmt.Sprintf(`
|
||||
SELECT A.idx, A.net_id, A.token_type, A.token_id, A.contract_address, B.status 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.owner_address=? `,
|
||||
cursor, netId)
|
||||
SELECT * FROM t_order WHERE net_id = %d AND status = "%s"`,
|
||||
netId,
|
||||
jccommon.ORDER_STATUS_ACTIVE)
|
||||
params := []string{accountAddress}
|
||||
if filterType == 1 {
|
||||
sql += " AND B.status = '" + jccommon.ORDER_STATUS_ACTIVE + "' "
|
||||
} else if filterType == 2 {
|
||||
sql += " AND (B.status IS NULL OR B.status <> '" + jccommon.ORDER_STATUS_ACTIVE + "') "
|
||||
}
|
||||
subFilters := []f5.DbQueryFilter{}
|
||||
{
|
||||
itemIds := map[int32]int32{}
|
||||
@ -138,7 +131,7 @@ WHERE A.idx > %d AND A.net_id = %d AND A.owner_address=? `,
|
||||
mt.Table.Item.Search(searchName, itemIds)
|
||||
}
|
||||
if len(itemIds) > 0 {
|
||||
inSub := `A.item_id IN (`
|
||||
inSub := `item_id IN (`
|
||||
i := 0
|
||||
for key, _ := range(itemIds) {
|
||||
if i == 0 {
|
||||
@ -178,11 +171,7 @@ WHERE A.idx > %d AND A.net_id = %d AND A.owner_address=? `,
|
||||
p.NetId = q5.ToInt32(ds.GetByName("net_id"))
|
||||
p.ContractAddress = ds.GetByName("contract_address")
|
||||
p.TokenId = ds.GetByName("token_id")
|
||||
if ds.GetByName("status") == jccommon.ORDER_STATUS_ACTIVE {
|
||||
p.Param1 = 1
|
||||
} else {
|
||||
|
||||
}
|
||||
q5.DecodeJson(ds.GetByName("event_data"), &p.Payload)
|
||||
q5.AppendSlice(&nfts, p)
|
||||
})
|
||||
GetCacheMgr().GetNfts(nfts)
|
||||
|
Loading…
x
Reference in New Issue
Block a user