This commit is contained in:
aozhiwei 2024-07-04 17:26:12 +08:00
parent 48fb7c3b08
commit e75fc6cad3
2 changed files with 14 additions and 16 deletions

View File

@ -59,7 +59,7 @@ func (this* nftLock) repair(ds *f5.DataSet) bool {
netId := q5.ToInt32(ds.GetByName("net_id")) netId := q5.ToInt32(ds.GetByName("net_id"))
idx := q5.ToInt64(ds.GetByName("idx")) idx := q5.ToInt64(ds.GetByName("idx"))
lockTo := ds.GetByName("lock_to") lockTo := ds.GetByName("lock_to")
if nftSyncStatus == 0 { if nftSyncStatus == 0 && lockTo != "" {
p := new(lockReturnValues) p := new(lockReturnValues)
if q5.DecodeJson(ds.GetByName("return_values"), p) == nil { if q5.DecodeJson(ds.GetByName("return_values"), p) == nil {
for _, val := range p.TokenIds { for _, val := range p.TokenIds {

View File

@ -150,9 +150,13 @@ SELECT * FROM t_order WHERE net_id = %d AND status = "%s"`,
ErrCode int32 `json:"errcode"` ErrCode int32 `json:"errcode"`
ErrMsg string `json:"errmsg"` ErrMsg string `json:"errmsg"`
Page common.StreamPagination `json:"page"` Page common.StreamPagination `json:"page"`
Rows []interface{} `json:"rows"` Rows []struct{
Event interface{} `json:"event"`
Nft interface{} `json:"nft"`
InShopCart int32 `json:"in_shopcart"`
Price string `json:"price"`
} `json:"rows"`
}{ }{
Rows : []interface{}{},
} }
nfts := []*common.NftDto{} nfts := []*common.NftDto{}
f5.GetGoStyleDb().StreamPageQuery( f5.GetGoStyleDb().StreamPageQuery(
@ -177,19 +181,13 @@ SELECT * FROM t_order WHERE net_id = %d AND status = "%s"`,
GetCacheMgr().GetNfts(nfts) GetCacheMgr().GetNfts(nfts)
{ {
for _, val := range nfts { for _, val := range nfts {
jsonData := val.NftCache.GetJsonData() p := q5.NewSliceElement(&rspObj.Rows)
if jsonData != nil { p.Event = val.Payload
if v, ok := jsonData.(map[string]interface{}); ok { p.Nft = val.NftCache.GetJsonData()
v := q5.MapClone(v) /*
if val.Param1 != 0 { if cartDb != nil && cartDb.GetGoods(val.NetId, val.ContractAddress, val.TokenId) != nil{
v["on_sale"] = 1 p.InShopCart = 1
} else { }*/
v["on_sale"] = 0
}
jsonData = v
}
}
q5.AppendSlice(&rspObj.Rows, jsonData)
} }
} }
c.JSON(200, rspObj) c.JSON(200, rspObj)