diff --git a/doc/AAMarket.py b/doc/AAMarket.py index 7f06ed06..392e9fca 100644 --- a/doc/AAMarket.py +++ b/doc/AAMarket.py @@ -44,7 +44,7 @@ class AAMarket(object): 'name': '/api/market/product/category/:net_id', 'desc': '获取上架出售的NFTs分类数量', 'group': '!AAMarket', - 'url': 'https://market-test.kingsome.cn/api/market/product/list/:net_id', + 'url': 'https://market-test.kingsome.cn/api/market/product/category/:net_id', 'params': [ [':net_id', 0, '链id'], ], @@ -93,46 +93,6 @@ class AAMarket(object): ['!rows', [_common.NftInfo()], '数据'], ] }, - { - 'method': 'POST', - 'name': '/api/hero/use/:net_id', - 'desc': '使用英雄(带入游戏内)', - 'group': '!AAMarket', - 'url': 'https://market-test.kingsome.cn/api/hero/use/:net_id', - 'is_json_params': True, - 'request_params': [ - [':net_id', 0, '链id'], - ['account_address', '', '钱包地址'], - ], - 'params': [ - ['!token_ids', [''], 'tokenId列表'], - ], - 'response': [ - _common.RspHead(), - ['trans_id', '', '事务id'], - ['!params', [''], '合约参数列表'], - ] - }, - { - 'method': 'POST', - 'name': '/api/guld_bullion/use/:net_id', - 'desc': '使用金砖(生成金币带入游戏内)', - 'group': '!AAMarket', - 'url': 'https://market-test.kingsome.cn/api/gold_bullion/use/:net_id', - 'is_json_params': True, - 'request_params': [ - [':net_id', 0, '链id'], - ['account_address', '', '钱包地址'], - ], - 'params': [ - ['!token_ids', [''], 'tokenId列表'], - ], - 'response': [ - _common.RspHead(), - ['trans_id', '', '事务id'], - ['!params', [''], '合约参数列表'], - ] - }, { 'method': 'GET', 'name': '/api/shopcart/list', @@ -161,7 +121,7 @@ class AAMarket(object): ['net_id', 0, '链id'], ['!tokens', [ ['token_id', '', 'token_id'], - ['token_type', 0, '1: hero 11:gold bullion'], + ['contract_address', '', 'contract_address'], ], 'nft list'] ], 'response': [ @@ -181,7 +141,7 @@ class AAMarket(object): ['net_id', 0, '链id'], ['!tokens', [ ['token_id', '', 'token_id'], - ['token_type', 0, '1: hero 11:gold bullion'], + ['contract_address', '', 'contract_address'], ], 'nft list'] ], 'response': [ diff --git a/sql/bcnftdb.sql b/sql/bcnftdb.sql index 903c3222..cfd74f66 100644 --- a/sql/bcnftdb.sql +++ b/sql/bcnftdb.sql @@ -156,6 +156,8 @@ CREATE TABLE `t_order` ( `net_id` bigint NOT NULL DEFAULT '0' COMMENT 'net_id', `token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id', `contract_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_address', + `item_id` int(11) NOT NULL DEFAULT '0' COMMENT 'item_id', + `price` varchar(60) NOT NULL DEFAULT '' COMMENT 'price', `start_time` int(11) NOT NULL DEFAULT '0' COMMENT 'start_time', `end_time` int(11) NOT NULL DEFAULT '0' COMMENT 'end_time', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT 'created_at', @@ -198,4 +200,22 @@ CREATE TABLE `t_sale` ( ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `t_shopcart` +-- + +DROP TABLE IF EXISTS `t_shopcart`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_shopcart` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `open_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'open_id', + `data` mediumblob COMMENT '购物车数据', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `idx_open_id` (`open_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; + -- Dump completed on 2015-08-19 18:51:22 diff --git a/webapp/controller/BaseController.class.php b/webapp/controller/BaseController.class.php index 6d453e4e..7eaa72c4 100644 --- a/webapp/controller/BaseController.class.php +++ b/webapp/controller/BaseController.class.php @@ -91,6 +91,7 @@ class BaseController { 'errcode' => $errcode, 'errmsg' => $errmsg, ))); + error_log('callstack:' . json_encode(debug_backtrace(), JSON_PRETTY_PRINT)); } echo json_encode(array( 'errcode' => $errcode, diff --git a/webapp/controller/BlockChainController.class.php b/webapp/controller/BlockChainController.class.php index 0d850ffd..7ecb69d1 100644 --- a/webapp/controller/BlockChainController.class.php +++ b/webapp/controller/BlockChainController.class.php @@ -218,7 +218,7 @@ class BlockChainController extends BaseAuthedController { myself()->_getNowTime(), myself()->_getAddress() ); - $okCb = function () use($tokenId, $itemId, $costItems, $lackItem) { + $okCb = function () use($tokenId, $itemId, $costItems, $lackItem, $goldNum) { $lackItem = null; if (!myself()->_hasEnoughItems($costItems, $lackItem)) { myself()->_rspErr(3, 'gold not enough');