1
This commit is contained in:
parent
e7a271533c
commit
e1b78d89ea
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user