1
This commit is contained in:
parent
e7a271533c
commit
e1b78d89ea
@ -63,7 +63,6 @@ class ShopController extends BaseAuthedController {
|
|||||||
public function buyGoods()
|
public function buyGoods()
|
||||||
{
|
{
|
||||||
$goodsUuid = getReqVal('goods_id', 0);
|
$goodsUuid = getReqVal('goods_id', 0);
|
||||||
$tokenType = getReqVal('token_type', '');
|
|
||||||
$goodsNum = getReqVal('goods_num', 0);
|
$goodsNum = getReqVal('goods_num', 0);
|
||||||
|
|
||||||
if ($goodsNum < 1) {
|
if ($goodsNum < 1) {
|
||||||
@ -101,25 +100,15 @@ class ShopController extends BaseAuthedController {
|
|||||||
myself()->_rspErr($errCode, $errMsg);
|
myself()->_rspErr($errCode, $errMsg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$desiredTokenType = $goodsMeta['token_type'];
|
|
||||||
$checkTokenType = splitStr1($desiredTokenType);
|
|
||||||
$tokenPos = array_search($tokenType, $checkTokenType, true);
|
|
||||||
$propertyChgService = new services\PropertyChgService();
|
$propertyChgService = new services\PropertyChgService();
|
||||||
$awardService = new services\AwardService();
|
$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);
|
$costItemId = myself()->getCostItemIdByTokenType($tokenType);
|
||||||
$costItems = array(
|
$costItems = array(
|
||||||
'item_id' => $costItemId,
|
'item_id' => $costItemId,
|
||||||
'item_num' => $goodsNum * $needPrice
|
'item_num' => $goodsNum * $needPrice
|
||||||
);
|
);
|
||||||
|
$tokenType = $goodsMeta['token_type'];
|
||||||
|
$price = $goodsMeta['price'];
|
||||||
if (!in_array(
|
if (!in_array(
|
||||||
$tokenType,
|
$tokenType,
|
||||||
array(
|
array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user