Merge branch 'hjb' of git.kingsome.cn:server/game2006api into hjb

This commit is contained in:
hujiabin 2024-06-21 16:27:01 +08:00
commit 10d9826a8d
4 changed files with 25 additions and 44 deletions

View File

@ -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': [

View File

@ -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

View File

@ -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,

View File

@ -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');