$tokenId, 'orderId' => $orderId, 'nftToken' => $nftToken, 'amount' => $amount, 'seller' => $seller, 'buyer' => $buyer, 'erc20' => $erc20, 'price' => $price, ), JSON_PRETTY_PRINT ) ); $o_link = $orderId; $conn = myself()->_getMysql(''); // 1. check order status $chk = SqlHelper::selectOne($conn, 't_market_store', array('status', 'idx', 'c_name', 'token_type'), 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' => 2, ) ); if ($r) { // 增加交易记录 $record = array( 'createtime' => myself()->_getNowTime(), 'order_id' => $chk['order_id'], 'o_link' => $o_link, 'seller' => $seller, 'buyer' => $buyer, 'tokenid' => $tokenId, 'amount' => $amount, 'name' => $chk['c_name'], 'type' => $chk['token_type'], ); $this->addTransactionRecord($record); $this->_rspOk(); return; } else { // 操作失败,暂时视为未找到订单 $this->_rspErr(2, 'order status error, o_link=' . $o_link); return; } } } }