...
This commit is contained in:
parent
95bb04db25
commit
12ac97878c
@ -700,6 +700,41 @@ class ShopController extends BaseAuthedController
|
||||
}
|
||||
}
|
||||
|
||||
public function buyDiamond()
|
||||
{
|
||||
$num = getReqVal('num', 0);
|
||||
$price = $this->normalizeWeb3Price($num);
|
||||
$item_id = V_ITEM_DIAMOND;
|
||||
$item_count = $num;
|
||||
|
||||
$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,
|
||||
'ext_data' => json_encode(array(
|
||||
'mode' => SHOP_BUY_MODE_NORMAL,
|
||||
)),
|
||||
));
|
||||
|
||||
$response['item_id'] = $item_id;
|
||||
$response['item_num'] = $item_count;
|
||||
|
||||
error_log("buy diamond, item_id = " . $item_id . " item_count = " . $item_count . " num = " . $num . " price = " . $price . " response = " . json_encode($response));
|
||||
|
||||
$this->_rspData(
|
||||
array(
|
||||
"block_chain" => $response
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function buyGoodsDS()
|
||||
{
|
||||
$idx = getReqVal('idx', 0);
|
||||
|
@ -146,10 +146,11 @@ class BuyShopGoodsCbService
|
||||
}
|
||||
}
|
||||
|
||||
private function getAccountId($address){
|
||||
private function getAccountId($address)
|
||||
{
|
||||
|
||||
$row = SqlHelper::ormSelectOne
|
||||
(myself()->_getMysql($address),
|
||||
$row = SqlHelper::ormSelectOne(
|
||||
myself()->_getMysql($address),
|
||||
't_user',
|
||||
array(
|
||||
'address' => $address
|
||||
@ -158,5 +159,4 @@ class BuyShopGoodsCbService
|
||||
|
||||
return $row['account_id'];
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user