This commit is contained in:
aozhiwei 2024-07-24 11:36:19 +08:00
parent 66e5392b13
commit 740df075f2
2 changed files with 2 additions and 40 deletions

View File

@ -7,44 +7,6 @@ import (
"main/constant"
)
func 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 ||
tokenType == jccommon.NFT_TYPE_CFHERO_NORMAL {
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"))
}
})
}
}
})
}
func GetNftItemIdQuality(netId int32, contractAddress string, tokenId string,
itemId *int32, quality *int32) {
f5.GetGoStyleDb().OrmSelectOne(

View File

@ -131,7 +131,7 @@ func (this* webHook) orderUpdatedCb(ds *f5.DataSet) bool {
var resultErr error
var itemId int32
var heroQuality int32
service.GetItemIdHeroQuality(netId, p.Data.Sell[0].ContractAddress, p.Data.Sell[0].TokenId,
service.GetNftItemIdQuality(netId, p.Data.Sell[0].ContractAddress, p.Data.Sell[0].TokenId,
&itemId, &heroQuality)
startTime := q5.SmartParseTimeToMills(q5.SafeToString(p.Data.StartAt))
endTime := q5.SmartParseTimeToMills(q5.SafeToString(p.Data.EndAt))
@ -220,7 +220,7 @@ func (this* webHook) activitySaleCb(ds *f5.DataSet) bool {
var resultErr error
var itemId int32
var heroQuality int32
service.GetItemIdHeroQuality(netId,
service.GetNftItemIdQuality(netId,
p.Data.Details.Asset[0].ContractAddress,
p.Data.Details.Asset[0].TokenId,
&itemId, &heroQuality)