This commit is contained in:
azw 2023-07-30 08:41:07 +08:00
parent 13852c7719
commit 2307d68d6b

View File

@ -114,9 +114,6 @@ class ShopController extends BaseAuthedController {
} }
} }
// 这里命名混乱了, 购买个数,一捆个数命名冲突
$goods_count = $goodsMeta['goods_num'];
$price_array = splitStr1($goodsMeta['price']); $price_array = splitStr1($goodsMeta['price']);
$discount_array = splitStr1($goodsMeta['discount']); $discount_array = splitStr1($goodsMeta['discount']);
@ -133,20 +130,15 @@ class ShopController extends BaseAuthedController {
$costItemId = $this->getCostItemIdByTokenType($tokenType); $costItemId = $this->getCostItemIdByTokenType($tokenType);
$costItems = $this->makeCostItems($costItemId, $goodsNum * $need_price); $costItems = $this->makeCostItems($costItemId, $goodsNum * $need_price);
switch ($tokenType) { if (!in_array(
case ShopController::TOKEN_TYPE_GOLD: $tokenType,
{ array(
} mt\Shop::TOKEN_TYPE_GOLD,
break; mt\Shop::TOKEN_TYPE_DIAMOND
case ShopController::TOKEN_TYPE_DIAMOND: )
{ )) {
}
break;
default:
{
$this->_rspErr(1, "token_type is unsupport, {$tokenType}"); $this->_rspErr(1, "token_type is unsupport, {$tokenType}");
} return;
break;
} }
$lackItem = null; $lackItem = null;
if (!$this->_hasEnoughItems($costItems, $lackItem)) { if (!$this->_hasEnoughItems($costItems, $lackItem)) {