60 lines
1.5 KiB
PHP
60 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace services;
|
|
require_once('MarketCallbackBase.php');
|
|
|
|
require_once ('services/callback/common/SignatureService.php');
|
|
|
|
use services\MarketCallbackBase;
|
|
use phpcommon\SqlHelper;
|
|
|
|
class MarketCancelOrderOk extends MarketCallbackBase
|
|
{
|
|
public function process()
|
|
{
|
|
SignatureService::web3ServiceCheck();
|
|
error_log('MarketCancelOrderOk:' . json_encode($_REQUEST, JSON_PRETTY_PRINT));
|
|
|
|
$orderId = getReqVal('orderId', '');
|
|
$nftToken = getReqVal('nftToken', '');
|
|
$tokenId = getReqVal('tokenId', '');
|
|
error_log(
|
|
"eventCancelOrder:" . json_encode(
|
|
array(
|
|
'orderId' => $orderId,
|
|
'nftToken' => $nftToken,
|
|
'tokenId' => $tokenId,
|
|
),
|
|
JSON_PRETTY_PRINT
|
|
)
|
|
);
|
|
|
|
$o_link = $orderId;
|
|
$conn = myself()->_getMysql('');
|
|
|
|
// 检查订单是否在销售中,并且没有人购买
|
|
$chk = SqlHelper::selectOne($conn, 't_market_store', array('status'), array('o_link' => $o_link, 'status' => 0));
|
|
if (empty($chk)) {
|
|
$this->_rspErr(2, 'not found order, o_link=' . $o_link);
|
|
return;
|
|
}
|
|
|
|
if ($chk['status'] == '0') {
|
|
$r = SqlHelper::update(
|
|
$conn,
|
|
't_market_store',
|
|
array(
|
|
'o_link' => $o_link
|
|
),
|
|
array(
|
|
'status' => 1,
|
|
)
|
|
);
|
|
if ($r) {
|
|
$this->_rspOk();
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|