43 lines
1.4 KiB
PHP
43 lines
1.4 KiB
PHP
<?php
|
|
use phpcommon\SqlHelper;
|
|
require_once('models/Nft.php');
|
|
|
|
use models\Nft;
|
|
class OutAppNftController extends BaseController {
|
|
|
|
public function getNftList(){
|
|
$address = getReqVal('address', '');
|
|
$type = getReqVal('type', '');
|
|
if ($type){
|
|
$nftList = Nft::getNftListByType($address,$type);
|
|
}else{
|
|
$nftList = Nft::getNftList($address);
|
|
}
|
|
$listInfo = array();
|
|
if ($nftList){
|
|
foreach ($nftList as $nft) {
|
|
$image = 'https://www.cebg.games/res/avatars/' . $nft['item_id'] . '.png';
|
|
$full_image = 'https://www.cebg.games/res/avatars/full_' . $nft['item_id'] . '.png';
|
|
$info = array(
|
|
"idx" => $nft['idx'],
|
|
"owner_address" => $nft['owner_address'],
|
|
"item_id" => $nft['item_id'],
|
|
"token_id" => $nft['token_id'],
|
|
"token_type" => $nft['token_type'],
|
|
"contract_address" => $nft['contract_address'],
|
|
'image' => $image,
|
|
'full_image' => $full_image,
|
|
"details" => array(),
|
|
);
|
|
array_push($listInfo,$info);
|
|
}
|
|
}
|
|
|
|
$this->_rspData(array(
|
|
'nfts' => $listInfo,
|
|
));
|
|
|
|
}
|
|
}
|
|
|