From c9d3a201700292f9ecf6f8c0b9d7943b585ce80d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 31 Aug 2023 15:41:36 +0800 Subject: [PATCH] 1 --- webapp/models/Transaction.php | 23 +++++++++++++++++++++++ webapp/services/BlockChainService.php | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/webapp/models/Transaction.php b/webapp/models/Transaction.php index 2e5bdc59..07e2c3be 100644 --- a/webapp/models/Transaction.php +++ b/webapp/models/Transaction.php @@ -92,6 +92,29 @@ class Transaction extends BaseModel { ); } + public static function addEx($address,$transId, $action, $tokenId, $tokenType, $itemUniId, $itemId, $itemNum, $result) + { + SqlHelper::insert( + myself()->_getMysql(''), + 't_transaction', + array( + 'account_id' => '', + 'address' => $address, + 'trans_id' => $transId, + 'action' => $action, + 'token_id' => $tokenId, + 'token_type' => $tokenType, + 'item_uniid' => $itemUniId, + 'item_id' => $itemId, + 'item_num' => $itemNum, + 'result' => $result, + 'status' => self::CREATED_STATUS, + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime(), + ) + ); + } + public static function getActionDesc($transDb) { switch ($transDb['action']) { diff --git a/webapp/services/BlockChainService.php b/webapp/services/BlockChainService.php index 57c518c9..cb041351 100644 --- a/webapp/services/BlockChainService.php +++ b/webapp/services/BlockChainService.php @@ -206,7 +206,8 @@ class BlockChainService { $rspObj = json_decode($response, true); if ($rspObj['errcode'] == 0) { $transId = $rspObj['trans_id']; - Transaction::add( + Transaction::addEx( + $address, $transId, $actionType, '', //$tokenId,