From 0d5cba719394d22eff7bcb5f5e7c756b245a0ee3 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 13 Jun 2024 10:31:10 +0800 Subject: [PATCH] 1 --- doc/BlockChain.py | 14 +++++++++++ sql/gamedb.sql | 1 + webapp/bootstrap/constant.php | 2 ++ .../controller/BlockChainController.class.php | 23 +++++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/doc/BlockChain.py b/doc/BlockChain.py index 5ad2875d..727c1574 100644 --- a/doc/BlockChain.py +++ b/doc/BlockChain.py @@ -73,6 +73,20 @@ class BlockChain(object): ['trans_req', _common.MFTransactionRequest(), '调用合约参数'], ] }, + { + 'name': 'mintGoldBullion', + 'desc': 'mint金砖', + 'group': 'BlockChain', + 'url': 'webapp/index.php?c=BlockChain&a=mintGoldBullion', + 'params': [ + ['type', 0, '1:1w金币 2:10w金币'], + ], + 'response': [ + _common.RspHead(), + ['trans_id', '', '事务id'], + ['trans_req', _common.MFTransactionRequest(), '调用合约参数'], + ] + }, { 'name': 'buyDiamond(废弃)', 'desc': '购买钻石', diff --git a/sql/gamedb.sql b/sql/gamedb.sql index fe704e82..5db510a2 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1792,6 +1792,7 @@ CREATE TABLE `t_gold_bullion` ( `src_address` varchar(60) COMMENT 'src_address', `token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id', `net_id` int(11) NOT NULL DEFAULT '0' COMMENT '链id', + `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id', `gold` bigint NOT NULL DEFAULT '0' COMMENT '金币', `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态 0:初始 1:已开', `open_status` int(11) NOT NULL DEFAULT '0' COMMENT '1: 已发送 2:未发送 3:已领取', diff --git a/webapp/bootstrap/constant.php b/webapp/bootstrap/constant.php index 188135c6..2245503d 100644 --- a/webapp/bootstrap/constant.php +++ b/webapp/bootstrap/constant.php @@ -25,6 +25,8 @@ define('V_ITEM_REVIVE_COIN', 140001); //复活币 define('V_ITEM_HERO_META', 100005); //英雄升级材料 define('V_ITEM_GUN_META', 100006); //枪械升级材料 define('V_ITEM_CHIP_META', 100007); //芯片升级材料 +define('V_ITEM_GOLD_BULLION_1W', 10017); //金砖1w +define('V_ITEM_GOLD_BULLION_10W', 10018); //金砖10w define('TN_BEGIN', 8001); define('TN_ACTIVE', 8002); diff --git a/webapp/controller/BlockChainController.class.php b/webapp/controller/BlockChainController.class.php index e31bae20..29031774 100644 --- a/webapp/controller/BlockChainController.class.php +++ b/webapp/controller/BlockChainController.class.php @@ -165,6 +165,29 @@ class BlockChainController extends BaseAuthedController { } } + public function mintGoldBullion() + { + $type = getReqVal('type', 0); + $itemId = 0; + switch ($type) { + case 1: + { + $itemId = V_ITEM_GOLD_BULLION_1W; + } + break; + case 2: + { + $itemId = V_ITEM_GOLD_BULLION_10W; + } + break; + default: + { + return; + } + } + + } + private function internalActivate721Nft($tokenId, $tokenType, $itemUniId, $itemId) { $params = array(