1
This commit is contained in:
parent
952aae2608
commit
6fdbe91bf6
@ -119,7 +119,7 @@ func (this* repairNft) updateNftItemId(netId int32, contractAddress string, toke
|
|||||||
{"net_id", q5.ToString(netId)},
|
{"net_id", q5.ToString(netId)},
|
||||||
{"contract_address", contractAddress},
|
{"contract_address", contractAddress},
|
||||||
{"token_id", tokenId},
|
{"token_id", tokenId},
|
||||||
{"item_id", q5.ToString(itemId)},
|
{"item_id", q5.ToString(0)},
|
||||||
},
|
},
|
||||||
[][]string {
|
[][]string {
|
||||||
{"item_id", q5.ToString(itemId)},
|
{"item_id", q5.ToString(itemId)},
|
||||||
@ -129,9 +129,87 @@ func (this* repairNft) updateNftItemId(netId int32, contractAddress string, toke
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this* repairNft) repairOrder(ds *f5.DataSet) bool {
|
func (this* repairNft) repairOrder(ds *f5.DataSet) bool {
|
||||||
|
netId := q5.ToInt32(ds.GetByName("net_id"))
|
||||||
|
contractAddress := ds.GetByName("contract_address")
|
||||||
|
tokenId := ds.GetByName("token_id")
|
||||||
|
switch q5.ToInt32(ds.GetByName("token_type")) {
|
||||||
|
case jccommon.NFT_TYPE_CFHERO:
|
||||||
|
{
|
||||||
|
var itemId int32
|
||||||
|
var quality int32
|
||||||
|
if service.GetHeroByTokenId(tokenId, &itemId, &quality) {
|
||||||
|
this.updateOrder(netId, contractAddress, tokenId, itemId, quality)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case jccommon.NFT_TYPE_GOLD_BULLION:
|
||||||
|
{
|
||||||
|
var itemId int32
|
||||||
|
if service.GetGoldBullionByNetIdTokenId(netId, tokenId, &itemId) {
|
||||||
|
this.updateOrder(netId, contractAddress, tokenId, itemId, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this* repairNft) updateOrder(netId int32, contractAddress string, tokenId string,
|
||||||
|
itemId int32, quality int32) {
|
||||||
|
f5.GetGoStyleDb().Update(
|
||||||
|
constant.BCNFT_DB,
|
||||||
|
"t_order",
|
||||||
|
[][]string {
|
||||||
|
{"net_id", q5.ToString(netId)},
|
||||||
|
{"contract_address", contractAddress},
|
||||||
|
{"token_id", tokenId},
|
||||||
|
{"item_id", q5.ToString(0)},
|
||||||
|
},
|
||||||
|
[][]string {
|
||||||
|
{"item_id", q5.ToString(itemId)},
|
||||||
|
{"hero_quality", q5.ToString(quality)},
|
||||||
|
},
|
||||||
|
func (err error, lastInsertId int64, rowsAffected int64) {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func (this* repairNft) repairSale(ds *f5.DataSet) bool {
|
func (this* repairNft) repairSale(ds *f5.DataSet) bool {
|
||||||
|
netId := q5.ToInt32(ds.GetByName("net_id"))
|
||||||
|
contractAddress := ds.GetByName("contract_address")
|
||||||
|
tokenId := ds.GetByName("token_id")
|
||||||
|
switch q5.ToInt32(ds.GetByName("token_type")) {
|
||||||
|
case jccommon.NFT_TYPE_CFHERO:
|
||||||
|
{
|
||||||
|
var itemId int32
|
||||||
|
var quality int32
|
||||||
|
if service.GetHeroByTokenId(tokenId, &itemId, &quality) {
|
||||||
|
this.updateSale(netId, contractAddress, tokenId, itemId, quality)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case jccommon.NFT_TYPE_GOLD_BULLION:
|
||||||
|
{
|
||||||
|
var itemId int32
|
||||||
|
if service.GetGoldBullionByNetIdTokenId(netId, tokenId, &itemId) {
|
||||||
|
this.updateSale(netId, contractAddress, tokenId, itemId, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this* repairNft) updateSale(netId int32, contractAddress string, tokenId string,
|
||||||
|
itemId int32, quality int32) {
|
||||||
|
f5.GetGoStyleDb().Update(
|
||||||
|
constant.BCNFT_DB,
|
||||||
|
"t_sale",
|
||||||
|
[][]string {
|
||||||
|
{"net_id", q5.ToString(netId)},
|
||||||
|
{"contract_address", contractAddress},
|
||||||
|
{"token_id", tokenId},
|
||||||
|
{"item_id", q5.ToString(0)},
|
||||||
|
},
|
||||||
|
[][]string {
|
||||||
|
{"item_id", q5.ToString(itemId)},
|
||||||
|
{"hero_quality", q5.ToString(quality)},
|
||||||
|
},
|
||||||
|
func (err error, lastInsertId int64, rowsAffected int64) {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user