From e1b78d89ea9c04403365d0bdc59c3c3bcfcb7771 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 31 Jul 2023 15:04:51 +0800 Subject: [PATCH] 1 --- webapp/controller/ShopController.class.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index b8a31772..dce731d4 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -63,7 +63,6 @@ class ShopController extends BaseAuthedController { public function buyGoods() { $goodsUuid = getReqVal('goods_id', 0); - $tokenType = getReqVal('token_type', ''); $goodsNum = getReqVal('goods_num', 0); if ($goodsNum < 1) { @@ -101,25 +100,15 @@ class ShopController extends BaseAuthedController { myself()->_rspErr($errCode, $errMsg); return; } - - $desiredTokenType = $goodsMeta['token_type']; - $checkTokenType = splitStr1($desiredTokenType); - $tokenPos = array_search($tokenType, $checkTokenType, true); $propertyChgService = new services\PropertyChgService(); $awardService = new services\AwardService(); - if (!in_array($tokenType, $checkTokenType)) { - myself()->_rspErr(1, "token_type parameter error, desired_token_type: {$desiredTokenType}"); - return; - } - - $priceArray = splitStr1($goodsMeta['price']); - $needPrice = $priceArray[$tokenPos]; - $costItemId = myself()->getCostItemIdByTokenType($tokenType); $costItems = array( 'item_id' => $costItemId, 'item_num' => $goodsNum * $needPrice ); + $tokenType = $goodsMeta['token_type']; + $price = $goodsMeta['price']; if (!in_array( $tokenType, array(