$tokenId, 'orderId' => $orderId, 'nftToken' => $nftToken, 'amount' => $amount, 'seller' => $seller, 'buyer' => $buyer, 'erc20' => $erc20, 'price' => $price, ), JSON_PRETTY_PRINT ) ); $conn = myself()->_getSelfMysql(); // 1. check order status $chk = SqlHelper::selectOne($conn, 't_market_store', array('status', 'idx', 'c_name', 'token_type'), array('o_link' => $orderId)); if (empty($chk)) { $this->_rspErr(1, 'not found order, orderId=' . $orderId); return; } if ($chk['status'] == '0') { $r = SqlHelper::update( $conn, 't_market_store', array( 'o_link' => $orderId, ), array( 'status' => 2, ) ); if ($r) { // 增加交易记录 $record = array( 'createtime' => myself()->_getNowTime(), 'orderid' => $chk['idx'], 'o_link' => $orderId, 'seller' => $seller, 'buyer' => $buyer, 'tokenid' => $tokenId, 'amount' => $amount, 'name' => $chk['c_name'], 'type' => $chk['token_type'], ); $this->addTransactionRecord($record); $this->_rspOk(); return; } } $this->_rspErr(1, 'order status error, order=' . $orderId); } }