From cdbbd13ef6b498d42c808109ccf70aa24abba1c3 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 9 Apr 2022 16:04:28 +0800 Subject: [PATCH] 1 --- webapp/controller/BcShopController.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/webapp/controller/BcShopController.class.php b/webapp/controller/BcShopController.class.php index 569d1aa3..4c68bbad 100644 --- a/webapp/controller/BcShopController.class.php +++ b/webapp/controller/BcShopController.class.php @@ -168,6 +168,10 @@ class BcShopController extends BaseController { myself()->_rspErr(1, 'account can only choose 1 hero to purchase'); return; } + $orderId = BuyRecord::genOrderId($gameId, + $funcId, + myself()->_getNowTime(), + $buyerAddress); $fieldsKv = array( 'game_id' => $gameId, @@ -191,18 +195,14 @@ class BcShopController extends BaseController { if ($i <= count($items)) { $tokenId = phpcommon\setOrderIdSubIdx($orderId, $i); $fieldsKv['bc_mint_tokenid' . $i] = $tokenId; - $fieldsKv['bc_mint_need' . $i] = $items[$i]['need']; - $fieldsKv['bc_mint_itemid' . $i] = $items[$i]['item_id']; - $fieldsKv['bc_mint_token_type' . $i] = $items[$i]['token_type']; + $fieldsKv['bc_mint_need' . $i] = $items[$i - 1]['need']; + $fieldsKv['bc_mint_itemid' . $i] = $items[$i - 1]['item_id']; + $fieldsKv['bc_mint_token_type' . $i] = $items[$i - 1]['token_type']; } } if (MarketService::isTestMode()) { $fieldsKv['bc_paid'] = 1; } - $orderId = BuyRecord::genOrderId($gameId, - $funcId, - myself()->_getNowTime(), - $buyerAddress); $fieldsKv['order_id'] = $orderId; SqlHelper::insert( myself()->_getMarketMysql(),