diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index a4529f9d..81049a47 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -1164,6 +1164,11 @@ class MarketController extends BaseAuthedController return; } + if (!$this->markOrderBuyStatus($idx)) { + $this->_rspErr(1, 'buy failed, update order status failed, idx:' . $idx); + return; + } + $this->_rspData(array( 'block_chain' => $response, )); @@ -1885,4 +1890,29 @@ class MarketController extends BaseAuthedController } return $row; } + + private function markOrderBuyStatus($idx) + { + $self = myself(); + if (!$self) { + return false; + } + + $r = SqlHelper::update( + $self->_getMarketMysql(''), + 't_market_store', + array( + 'idx' => $idx, + ), + array( + 'status' => 3, + 'buytime' => $self->_getNowTime(), + ) + ); + if (!$r) { + return false; + } + + return true; + } }