diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 1cfa68b8..0a5d9c0c 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -854,6 +854,7 @@ CREATE TABLE `t_transaction` ( `token_type` int(11) NOT NULL DEFAULT '0' COMMENT 'token_type', `item_uniid` bigint NOT NULL DEFAULT '0' COMMENT '道具uniid', `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id', + `item_num` bigint NOT NULL DEFAULT '0' COMMENT '道具num', `status` int(11) NOT NULL DEFAULT '0' COMMENT 'status', `result` int(11) NOT NULL DEFAULT '0' COMMENT 'result 0:失败 1:成功', `client_confirmed` int(11) NOT NULL DEFAULT '0' COMMENT 'client_confirmed', diff --git a/sql/gamedb2006_migrate_230619_01.sql b/sql/gamedb2006_migrate_230619_01.sql index f77afcbe..0cf6338d 100644 --- a/sql/gamedb2006_migrate_230619_01.sql +++ b/sql/gamedb2006_migrate_230619_01.sql @@ -1,5 +1,7 @@ begin; +alter table t_transaction add column `item_num` bigint NOT NULL DEFAULT '0' COMMENT '道具num'; + CREATE TABLE `t_bc_order` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `order_id` varchar(255) COMMENT '订单号', diff --git a/webapp/services/BlockChainService.php b/webapp/services/BlockChainService.php index c68e263c..ed586e12 100644 --- a/webapp/services/BlockChainService.php +++ b/webapp/services/BlockChainService.php @@ -4,7 +4,7 @@ namespace services; class BlockChainService { - public static function gameItemMallBuy($actionType, $price) + public static function gameItemMallBuy($actionType, $price, $itemId, $itemNum) { if (!($actionType > Transaction::BUY_BEGIN_ACTION_TYPE && $actionType < Transaction::BUY_END_ACTION_TYPE)) { @@ -43,10 +43,10 @@ class BlockChainService { 0, //$itemId, 1 ); - myself()->_rspData(array( + return array( 'trans_id' => $transId, 'params' => $rspObj['params'] - )); + ); } else { myself()->_rspErr(500, 'server internal error'); die();