...
This commit is contained in:
parent
b843229d02
commit
1797f290c1
@ -1041,19 +1041,11 @@ class ShopController extends BaseAuthedController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_log("buyGoodsDS start " . $address);
|
|
||||||
|
|
||||||
$idx = getReqVal('idx', 0);
|
$idx = getReqVal('idx', 0);
|
||||||
$grid = getReqVal('grid', 0);
|
$grid = getReqVal('grid', 0);
|
||||||
$count = getReqVal('count', 0);
|
$count = getReqVal('count', 0);
|
||||||
|
|
||||||
$conn = $this->_getMysql('');
|
$conn = $this->_getMysql('');
|
||||||
error_log("buyGoodsDS start " . json_encode(array(
|
|
||||||
'idx' => $idx,
|
|
||||||
'grid' => $grid,
|
|
||||||
'count' => $count,
|
|
||||||
)
|
|
||||||
));
|
|
||||||
|
|
||||||
$row = SqlHelper::selectOne(
|
$row = SqlHelper::selectOne(
|
||||||
$conn,
|
$conn,
|
||||||
@ -1067,13 +1059,6 @@ class ShopController extends BaseAuthedController
|
|||||||
array('idx' => $idx)
|
array('idx' => $idx)
|
||||||
);
|
);
|
||||||
|
|
||||||
error_log("buyGoodsDS start " . json_encode(array(
|
|
||||||
'idx' => $idx,
|
|
||||||
'grid' => $grid,
|
|
||||||
'count' => $count,
|
|
||||||
)
|
|
||||||
));
|
|
||||||
|
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
$this->_rspErr(2, 'idx is invalid');
|
$this->_rspErr(2, 'idx is invalid');
|
||||||
return;
|
return;
|
||||||
@ -1102,26 +1087,12 @@ class ShopController extends BaseAuthedController
|
|||||||
$item_id = $goods['goods_id'];
|
$item_id = $goods['goods_id'];
|
||||||
$item_count = $goods['goods_num'] * $count;
|
$item_count = $goods['goods_num'] * $count;
|
||||||
|
|
||||||
error_log("buyGoodsDS start " . json_encode(array(
|
|
||||||
'idx' => $idx,
|
|
||||||
'grid' => $grid,
|
|
||||||
'count' => $count,
|
|
||||||
)
|
|
||||||
));
|
|
||||||
|
|
||||||
$response = services\BlockChainService::gameItemMallBuy(
|
$response = services\BlockChainService::gameItemMallBuy(
|
||||||
Transaction::BUY_GOODS_ACTION_TYPE,
|
Transaction::BUY_GOODS_ACTION_TYPE,
|
||||||
$price,
|
$price,
|
||||||
$item_id,
|
$item_id,
|
||||||
$item_count
|
$item_count
|
||||||
);
|
);
|
||||||
error_log("buyGoodsDS start " . json_encode(array(
|
|
||||||
'idx' => $idx,
|
|
||||||
'grid' => $grid,
|
|
||||||
'count' => $count,
|
|
||||||
'block_chain' => $response,
|
|
||||||
)
|
|
||||||
));
|
|
||||||
|
|
||||||
BcOrder::upsert($response['trans_id'], array(
|
BcOrder::upsert($response['trans_id'], array(
|
||||||
'item_id' => $item_id,
|
'item_id' => $item_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user