From 45e30c08a776244b3247b16e7dab75608711a215 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 19 Jun 2023 13:16:54 +0800 Subject: [PATCH] 1 --- webapp/models/Transaction.php | 7 +++++++ webapp/services/BlockChainService.php | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/webapp/models/Transaction.php b/webapp/models/Transaction.php index 75432b4e..c13b1b14 100644 --- a/webapp/models/Transaction.php +++ b/webapp/models/Transaction.php @@ -16,6 +16,13 @@ class Transaction extends BaseModel { const PLUGIN_CHIP_ACTION_TYPE = 7; const UNPLUG_CHIP_ACTION_TYPE = 8; + const BUY_BEGIN_ACTION_TYPE = 100; + + const BUY_EXP_ACTION_TYPE = 101; + const BUY_PASS_ACTION_TYPE = 102; + + const BUY_END_ACTION_TYPE = 200; + const CREATED_STATUS = 1; const REPORTED_STATUS = 2; const COMPLETED_STATUS = 3; diff --git a/webapp/services/BlockChainService.php b/webapp/services/BlockChainService.php index fea3a40f..a0956dfb 100644 --- a/webapp/services/BlockChainService.php +++ b/webapp/services/BlockChainService.php @@ -4,8 +4,12 @@ namespace services; class BlockChainService { - public static function gameItemMallBuy($account, $price) + public static function gameItemMallBuy($actionType, $account, $price) { + if (!($actionType > Transaction::BUY_BEGIN_ACTION_TYPE && + $actionType < Transaction::BUY_END_ACTION_TYPE)) { + + } $params = array( 'c' => 'GameItemMall', 'a' => 'buy', @@ -29,7 +33,7 @@ class BlockChainService { $transId = $rspObj['trans_id']; Transaction::add( $transId, - Transaction::MINT_721_ACTION_TYPE, + $actionType, $tokenId, $tokenType, $itemUniId,