1
This commit is contained in:
parent
12ea460246
commit
0d945f7a49
@ -237,59 +237,6 @@ class ShopController extends BaseAuthedController {
|
||||
)
|
||||
);
|
||||
break;
|
||||
case ShopController::TOKEN_TYPE_CEG:
|
||||
case ShopController::TOKEN_TYPE_CEC:
|
||||
if ($isFreeBuy) {
|
||||
$propertyChgService = new services\PropertyChgService();
|
||||
$this->addFreeBuyRecord($goodsMeta);
|
||||
$itemMeta = mt\Item::get($goodsMeta['goods_id']);
|
||||
$this->internalAddItem($propertyChgService, $itemMeta, $goods_count, 1);
|
||||
$this->_rspOk();
|
||||
} else {
|
||||
$price = $this->normalizeWeb3Price($goodsNum * $need_price);
|
||||
$item_id = $goodsMeta['goods_id'];
|
||||
$item_count = $goodsNum;
|
||||
|
||||
$response = services\BlockChainService::gameItemMallBuy(
|
||||
Transaction::BUY_GOODS_ACTION_TYPE,
|
||||
$price,
|
||||
$item_id,
|
||||
$item_count
|
||||
);
|
||||
|
||||
BcOrder::upsert($response['trans_id'], array(
|
||||
'item_id' => $item_id,
|
||||
'item_num' => $item_count,
|
||||
'order_type' => 1,
|
||||
'price' => $goodsNum * $need_price,
|
||||
'ext_data' => json_encode(array(
|
||||
'mode' => SHOP_BUY_MODE_NORMAL,
|
||||
'shop_id' => $goodsMeta['shop_id'],
|
||||
'id' => $id,
|
||||
)),
|
||||
));
|
||||
|
||||
$response['item_id'] = $item_id;
|
||||
$response['item_num'] = $item_count;
|
||||
|
||||
error_log("buy normal, item_id = " . $item_id . " item_count = " . $item_count . " need_price = " . $need_price . " price = " . $price . " response = " . json_encode($response));
|
||||
|
||||
$this->_rspData(
|
||||
array(
|
||||
"block_chain" => $response
|
||||
)
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case ShopController::TOKEN_TYPE_BCEG:
|
||||
break;
|
||||
|
||||
case ShopController::TOKEN_TYPE_USDT:
|
||||
case ShopController::TOKEN_TYPE_USDC:
|
||||
case ShopController::TOKEN_TYPE_BUSD:
|
||||
case ShopController::TOKEN_TYPE_MATIC:
|
||||
case ShopController::TOKEN_TYPE_BNB:
|
||||
default: {
|
||||
$this->_rspErr(1, "token_type is unsupport, {$tokenType}");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user