This commit is contained in:
aozhiwei 2022-04-04 08:34:06 +08:00
parent 11e41d3824
commit 840236d613
2 changed files with 32 additions and 18 deletions

View File

@ -186,15 +186,10 @@ class MarketController extends BaseController {
return;
}
$orderId = BuyRecord::genOrderId($gameId,
$funcId,
myself()->_getNowTime(),
$buyerAddress);
$fieldsKv = array(
'game_id' => $gameId,
'func_id' => $funcId,
'batch_idx' => $currBatchMeta['id'],
'order_id' => $orderId,
'type' => $type,
'raw_buyer_address' => $rawBuyerAddress,
'buyer_address' => $buyerAddress,
@ -207,22 +202,39 @@ class MarketController extends BaseController {
'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime()
);
{
//for test
if (MarketService::isTestMode()) {
$fieldsKv['bc_paid'] = 1;
for ($i = 1; $i <= 3; ++$i) {
if ($i <= 3) {
$tokenId = phpcommon\setOrderIdSubIdx($orderId, $i);
$tokenType = 0;
$fieldsKv['bc_mint_need' . $i] = 1;
$fieldsKv['bc_mint_tokenid' . $i] = $tokenId;
$fieldsKv['bc_mint_itemid' . $i] = $itemId;
$fieldsKv['bc_mint_token_type' . $i] = $tokenType;
}
if ($itemMeta['type'] == mt\Item::BLIND_BOX_TYPE) {
for ($i = 1; $i <= 3; ++$i) {
if ($i <= 3) {
$tokenId = phpcommon\setOrderIdSubIdx($orderId, $i);
$tokenType = 0;
$fieldsKv['bc_mint_need' . $i] = 1;
$fieldsKv['bc_mint_tokenid' . $i] = $tokenId;
$fieldsKv['bc_mint_itemid' . $i] = $itemId;
$fieldsKv['bc_mint_token_type' . $i] = $tokenType;
}
}
} else {
$tokenType = Nft::getTokenType($itemMeta);
if ($tokenType == Nft::NONE_TYPE) {
myself()->_rspErr(500, 'server internal error');
return;
} else {
$i = 1;
$tokenId = phpcommon\setOrderIdSubIdx($orderId, $i);
$fieldsKv['bc_mint_need' . $i] = 1;
$fieldsKv['bc_mint_tokenid' . $i] = $tokenId;
$fieldsKv['bc_mint_itemid' . $i] = $itemId;
$fieldsKv['bc_mint_token_type' . $i] = $tokenType;
}
}
if (MarketService::isTestMode()) {
$fieldsKv['bc_paid'] = 1;
}
$orderId = BuyRecord::genOrderId($gameId,
$funcId,
myself()->_getNowTime(),
$buyerAddress);
$fieldsKv['order_id'] = $orderId;
SqlHelper::insert(
myself()->_getMarketMysql(),
't_box_order',

View File

@ -22,6 +22,7 @@ class Item {
9 功能性道具
10 材料
11 碎片
12 盲盒
*/
/*
@ -75,6 +76,7 @@ class Item {
const FUNC_TYPE = 9;
const MATERIAL_TYPE = 10;
const FRAGMENT_TYPE = 11;
const BLIND_BOX_TYPE = 12;
const FUNC_RENAME_CARD_SUBTYPE = 1;
const MATERIAL_CHIP_SUBTYPE = 3;