This commit is contained in:
songliang 2023-07-17 17:22:22 +08:00
parent 46a2173c2c
commit 3afd541cc6

View File

@ -116,11 +116,21 @@ class GameItemMarketBuyOk
private function buyFromMarket($order, $idx) private function buyFromMarket($order, $idx)
{ {
$address = $order['address']; $address = $order['address'];
$goods = $this->getMarketGoods($address, $idx); $goods = $this->getMarketGoodsOnSale($address, $idx);
if (!$goods) { {
error_log('buyFromMarket goods not found, address:' . $address . ' idx:' . $idx);
//埋点
$event = [
'name' => LogService::MARKET_BUY_GOLD,
'val' => $goods['amount']
];
LogService::productGold($event, ['account_id' => $address, 'result' => 'fail']);
}
return;
}
$this->markMarketGoodsSold($address, $idx); $this->markMarketGoodsSold($address, $idx);
$this->_addGoods($address, $goods); $this->_addGoods($address, $goods); {
{
//埋点 //埋点
$event = [ $event = [
'name' => LogService::MARKET_BUY_GOLD, 'name' => LogService::MARKET_BUY_GOLD,
@ -130,14 +140,15 @@ class GameItemMarketBuyOk
} }
} }
private function getMarketGoods($address, $idx) private function getMarketGoodsOnSale($address, $idx)
{ {
$row = SqlHelper::selectOne( $row = SqlHelper::selectOne(
myself()->_getMysql($address), myself()->_getMysql($address),
't_market_store', 't_market_store',
array('order_id', 'item_id', 'amount', 's_price', 'owner_address'), array('order_id', 'item_id', 'amount', 's_price', 'owner_address'),
array( array(
'idx' => $idx 'idx' => $idx,
'status' => 0,
) )
); );
if (!$row) { if (!$row) {