This commit is contained in:
songliang 2023-06-25 20:31:00 +08:00
parent b843229d02
commit 1797f290c1

View File

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