diff --git a/server/backtask/task/webhook.go b/server/backtask/task/webhook.go index 1c75aeb1..07e4af24 100644 --- a/server/backtask/task/webhook.go +++ b/server/backtask/task/webhook.go @@ -220,4 +220,37 @@ func (this* webHook) activitySaleCb(ds *f5.DataSet) bool { func (this* webHook) getItemIdHeroQuality(netId int32, contractAddress string, tokenId string, itemId *int32, heroQuality *int32) { + f5.GetGoStyleDb().OrmSelectOne( + constant.BCNFT_DB, + "t_nft", + [][]string { + {"net_id", q5.ToString(netId)}, + {"contract_address", contractAddress}, + {"token_id", tokenId}, + }, + func (err error, ds *f5.DataSet) { + if err != nil { + return + } + if ds.Next() { + *itemId = q5.ToInt32(ds.GetByName("item_id")) + tokenType := q5.ToInt32(ds.GetByName("token_type")) + if tokenType == jccommon.NFT_TYPE_CFHERO { + f5.GetGoStyleDb().OrmSelectOne( + constant.GAME_DB, + "t_hero", + [][]string { + {"token_id", tokenId}, + }, + func (err error, ds *f5.DataSet) { + if err != nil { + return + } + if ds.Next() { + *heroQuality = q5.ToInt32(ds.GetByName("quality")) + } + }) + } + } + }) }