This commit is contained in:
aozhiwei 2024-06-27 20:48:53 +08:00
parent 6f9fce64d7
commit b70c939eaa
2 changed files with 13 additions and 4 deletions

View File

@ -57,7 +57,8 @@ CREATE TABLE `t_mail` (
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
UNIQUE KEY `idx` (`idx`),
UNIQUE KEY `unikey` (`unikey`),
PRIMARY KEY (`mail_id`)
UNIQUE KEY `mail_id` (`mail_id`),
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

View File

@ -209,10 +209,14 @@ SELECT * FROM t_sale WHERE idx > %d AND net_id = %d `,
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"`
} `json:"rows"`
}{
Rows : []interface{}{},
}
q5.NewSlice(&rspObj.Rows, 0, 10)
orderBy := ""
nfts := []*common.NftDto{}
f5.GetGoStyleDb().StreamPageQuery(
@ -231,12 +235,16 @@ SELECT * FROM t_sale WHERE idx > %d AND net_id = %d `,
p.NetId = q5.ToInt32(ds.GetByName("net_id"))
p.ContractAddress = ds.GetByName("contract_address")
p.TokenId = ds.GetByName("token_id")
p.Payload = map[string]interface{}{}
q5.DecodeJson(ds.GetByName("event_data"), &p.Payload)
q5.AppendSlice(&nfts, p)
})
GetCacheMgr().GetNfts(nfts)
{
for _, val := range nfts {
q5.AppendSlice(&rspObj.Rows, val.NftCache.GetJsonData())
p := q5.NewSliceElement(&rspObj.Rows)
p.Event = val.Payload
p.Nft = val.NftCache.GetJsonData()
}
}
c.JSON(200, rspObj)