1
This commit is contained in:
parent
38b2c64ef7
commit
3512637806
@ -176,13 +176,37 @@ class OutAppNftController extends BaseController {
|
||||
myself()->_rspData($info);
|
||||
}
|
||||
|
||||
public function nftDetailList()
|
||||
{
|
||||
$data = file_get_contents('php://input');
|
||||
$dataJson = json_decode($data, true);
|
||||
if (count($dataJson['nfts']) > 20) {
|
||||
myself()->_rspErr(1, 'nfts count error');
|
||||
return;
|
||||
}
|
||||
foreach ($dataJson['nfts'] as $row) {
|
||||
$netId = $row['net_id'];
|
||||
$contractAddress = $row['contract_address'];
|
||||
$tokenId = $row['token_id'];
|
||||
$nftDb = Nft::getNftByNetIdContractAddressTokenId($netId, $contractAddress, $tokenId);
|
||||
if (!empty($nftDb)) {
|
||||
$info = array();
|
||||
$this->internalNftDetail($netId, $nftDb, $info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function nftDetailByContractAddress()
|
||||
{
|
||||
$contractAddress = getReqVal('contract_address', '');
|
||||
$netId = getReqVal('net_id', '');
|
||||
$tokenId = getReqVal('token_id', '');
|
||||
$nftDb = Nft::getNftByNetIdContractAddressTokenId($netId, $contractAddress, $tokenId);
|
||||
$this->internalNftDetail($netId, $nftDb);
|
||||
$info = array();
|
||||
error_log(json_encode($_REQUEST));
|
||||
$this->internalNftDetail($netId, $nftDb, $info);
|
||||
error_log(json_encode($info));
|
||||
myself()->_rspData($info);
|
||||
}
|
||||
|
||||
public function nftDetailByTokenType()
|
||||
@ -191,10 +215,14 @@ class OutAppNftController extends BaseController {
|
||||
$tokenType = getReqVal('token_type', '');
|
||||
$tokenId = getReqVal('token_id', '');
|
||||
$nftDb = Nft::getNftByNetIdTokenTypeTokenId($netId, $tokenType, $tokenId);
|
||||
$this->internalNftDetail($netId, $nftDb);
|
||||
$info = array();
|
||||
error_log(json_encode($_REQUEST));
|
||||
$this->internalNftDetail($netId, $nftDb, $info);
|
||||
error_log(json_encode($info));
|
||||
myself()->_rspData($info);
|
||||
}
|
||||
|
||||
private function internalNftDetail($netId, $nftDb)
|
||||
private function internalNftDetail($netId, &$nftDb, &$info)
|
||||
{
|
||||
$info = array(
|
||||
'net_id' => $netId,
|
||||
@ -208,12 +236,9 @@ class OutAppNftController extends BaseController {
|
||||
'image' => '',
|
||||
'detail' => array()
|
||||
);
|
||||
error_log(json_encode($_REQUEST));
|
||||
if (!empty($nftDb)) {
|
||||
$this->internalGetNftDetail($nftDb, $info);
|
||||
}
|
||||
error_log(json_encode($info));
|
||||
myself()->_rspData($info);
|
||||
}
|
||||
|
||||
private function internalGetNftDetail($nftDb, &$info) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user