...
This commit is contained in:
parent
64ea33df3b
commit
04e450ce6c
@ -228,6 +228,8 @@ class MarketController extends BaseAuthedController
|
|||||||
|
|
||||||
public function listSellNfts()
|
public function listSellNfts()
|
||||||
{
|
{
|
||||||
|
$this->autoRestoreBuyingOrders();
|
||||||
|
|
||||||
$account = strtolower(getReqVal('account', ''));
|
$account = strtolower(getReqVal('account', ''));
|
||||||
$token = getReqVal('token', '');
|
$token = getReqVal('token', '');
|
||||||
$start = getReqVal('start', 0);
|
$start = getReqVal('start', 0);
|
||||||
@ -756,7 +758,7 @@ class MarketController extends BaseAuthedController
|
|||||||
$goods['amount']
|
$goods['amount']
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$this->markOrderBuyStatus($idx)) {
|
if (!$this->markOrderBuying($idx)) {
|
||||||
$this->_rspErr(1, 'buy failed, update order status failed, idx:' . $idx);
|
$this->_rspErr(1, 'buy failed, update order status failed, idx:' . $idx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -906,7 +908,7 @@ class MarketController extends BaseAuthedController
|
|||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function markOrderBuyStatus($idx)
|
private function markOrderBuying($idx)
|
||||||
{
|
{
|
||||||
$r = SqlHelper::update(
|
$r = SqlHelper::update(
|
||||||
myself()->_getSelfMysql(),
|
myself()->_getSelfMysql(),
|
||||||
@ -925,4 +927,31 @@ class MarketController extends BaseAuthedController
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function autoRestoreBuyingOrders()
|
||||||
|
{
|
||||||
|
$conn = myself()->_getSelfMysql();
|
||||||
|
|
||||||
|
$rows = $conn->execQuery(
|
||||||
|
'SELECT * FROM t_market_store ' .
|
||||||
|
'WHERE status=3 AND buytime<:buytime',
|
||||||
|
array(
|
||||||
|
':buytime' => myself()->_getNowTime() - 3600 * 24 * 1,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
$r = SqlHelper::update(
|
||||||
|
myself()->_getSelfMysql(),
|
||||||
|
't_market_store',
|
||||||
|
array(
|
||||||
|
'idx' => $row['idx'],
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'status' => 0,
|
||||||
|
'buytime' => 0,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user