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"))
idx := q5.ToInt64(ds.GetByName("idx"))
lockTo := ds.GetByName("lock_to")
if nftSyncStatus == 0 {
if nftSyncStatus == 0 && lockTo != "" {
p := new(lockReturnValues)
if q5.DecodeJson(ds.GetByName("return_values"), p) == nil {
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"`
ErrMsg string `json:"errmsg"`
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{}
f5.GetGoStyleDb().StreamPageQuery(
@ -177,19 +181,13 @@ SELECT * FROM t_order WHERE net_id = %d AND status = "%s"`,
GetCacheMgr().GetNfts(nfts)
{
for _, val := range nfts {
jsonData := val.NftCache.GetJsonData()
if jsonData != nil {
if v, ok := jsonData.(map[string]interface{}); ok {
v := q5.MapClone(v)
if val.Param1 != 0 {
v["on_sale"] = 1
} else {
v["on_sale"] = 0
}
jsonData = v
}
}
q5.AppendSlice(&rspObj.Rows, jsonData)
p := q5.NewSliceElement(&rspObj.Rows)
p.Event = val.Payload
p.Nft = val.NftCache.GetJsonData()
/*
if cartDb != nil && cartDb.GetGoods(val.NetId, val.ContractAddress, val.TokenId) != nil{
p.InShopCart = 1
}*/
}
}
c.JSON(200, rspObj)